Class: DHLEcommerceEU::BaseObject

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/dhl_ecommerce_eu/objects/base_object.rb

Direct Known Subclasses

Label, Shipment, Tracking

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BaseObject

Returns a new instance of BaseObject.



5
6
7
8
9
10
# File 'lib/dhl_ecommerce_eu/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

#attributesObject (readonly)

Returns the value of attribute attributes.



3
4
5
# File 'lib/dhl_ecommerce_eu/objects/base_object.rb', line 3

def attributes
  @attributes
end