Class: Blastramp::InventoryCount
- Inherits:
-
Object
- Object
- Blastramp::InventoryCount
- Defined in:
- lib/blastramp/inventory_count.rb
Instance Method Summary collapse
-
#initialize(hash) ⇒ InventoryCount
constructor
A new instance of InventoryCount.
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 |