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
Reads an attribute value.
-
#to_hash ⇒ Hash
private
Coerces a struct to a hash.
-
#to_s ⇒ String
Returns a short string representation.
Instance Method Details
#[](name) ⇒ Object
Reads an attribute value
24 25 26 |
# File 'lib/rom/struct.rb', line 24 def [](name) __send__(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.
Coerces a struct to a hash
13 14 15 |
# File 'lib/rom/struct.rb', line 13 def to_hash to_h end |
#to_s ⇒ String
Returns a short string representation
33 34 35 |
# File 'lib/rom/struct.rb', line 33 def to_s "#<#{self.class}:0x#{(object_id << 1).to_s(16)}>" end |