Class: TorqueAPI::Base

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/torque_api/object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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