Class: DHLAPI::BaseObject
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- DHLAPI::BaseObject
- Defined in:
- lib/dhl_api/objects/base_object.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ BaseObject
constructor
A new instance of BaseObject.
Constructor Details
#initialize(attributes = {}) ⇒ BaseObject
Returns a new instance of BaseObject.
5 6 7 8 9 10 |
# File 'lib/dhl_api/objects/base_object.rb', line 5 def initialize(attributes = {}) @attributes = attributes ostruct = to_ostruct(attributes) ostruct = ostruct.empty? ? nil : ostruct super ostruct end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/dhl_api/objects/base_object.rb', line 3 def attributes @attributes end |