Class: ROM::Struct
- Inherits:
-
Object
- Object
- ROM::Struct
- Defined in:
- lib/rom/struct.rb
Overview
Simple data-struct
By default mappers use this as the model
Instance Method Summary collapse
-
#[](name) ⇒ Object
Access attribute value.
-
#to_hash ⇒ Hash
private
Coerce to hash.
Instance Method Details
#[](name) ⇒ Object
Access attribute value
28 29 30 |
# File 'lib/rom/struct.rb', line 28 def [](name) instance_variable_get("@#{name}") end |
#to_hash ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Coerce to hash
17 18 19 |
# File 'lib/rom/struct.rb', line 17 def to_hash to_h end |