Class: DHL::Ecommerce::Base
- Inherits:
-
Object
- Object
- DHL::Ecommerce::Base
- Defined in:
- lib/dhl/ecommerce/base.rb
Direct Known Subclasses
Account, Event, Impb, Label, Location, Manifest, Product, StandardAddress, TrackedEvent
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/dhl/ecommerce/base.rb', line 4 def initialize(attributes = {}) attributes.each do |attribute, value| next if attribute.to_sym == :class if respond_to? "#{attribute}=" send "#{attribute}=", value elsif respond_to?("#{attribute}") instance_variable_set "@#{attribute}", value end end unless attributes.empty? end |