Class: TorqueAPI::Base
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- TorqueAPI::Base
- Defined in:
- lib/torque_api/object.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#original_response ⇒ Object
readonly
Returns the value of attribute original_response.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Base
constructor
A new instance of Base.
- #raw ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Base
Returns a new instance of Base.
8 9 10 11 |
# File 'lib/torque_api/object.rb', line 8 def initialize(attributes) @original_response = deep_freeze(attributes) super(to_ostruct(attributes)) end |
Instance Attribute Details
#original_response ⇒ Object (readonly)
Returns the value of attribute original_response.
6 7 8 |
# File 'lib/torque_api/object.rb', line 6 def original_response @original_response end |
Instance Method Details
#raw ⇒ Object
17 18 19 |
# File 'lib/torque_api/object.rb', line 17 def raw @original_response end |
#to_hash ⇒ Object
13 14 15 |
# File 'lib/torque_api/object.rb', line 13 def to_hash ostruct_to_hash(self) end |