Class: DHL::Ecommerce::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/dhl/ecommerce/base.rb

Instance Method Summary collapse

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