class RatatuiRuby::Error::Safety
Object lifetime violation.
Some objects are only valid during specific scopes. Using them after their scope ends causes undefined behavior.
This error prevents use-after-scope bugs. The object you’re accessing is no longer valid.
To resolve, ensure scoped objects are used only within their valid lifetime (e.g., inside the block where they’re created).
Example
stored_frame = nil RatatuiRuby.draw { |frame| stored_frame = frame } stored_frame.area # => raises Error::Safety