Class: Blastramp::InventoryCount

Inherits:
Object
  • Object
show all
Defined in:
lib/blastramp/inventory_count.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ InventoryCount

Returns a new instance of InventoryCount.



3
4
5
6
7
8
# File 'lib/blastramp/inventory_count.rb', line 3

def initialize(hash)
  hash.each do |k,v|
    self.instance_variable_set("@#{k}", v)  ## create and initialize an instance variable for this key/value pair
    self.class.send(:define_method, k, proc{self.instance_variable_get("@#{k}")})  ## create the getter that returns the instance variable
  end
end