Class: EME::Billing::Item

Inherits:
ObjectHash show all
Defined in:
lib/eme/billing.rb

Instance Method Summary collapse

Methods inherited from ObjectHash

#method_missing

Constructor Details

#initialize(key_values) ⇒ Item

Returns a new instance of Item.



445
446
447
448
449
450
451
452
453
454
455
# File 'lib/eme/billing.rb', line 445

def initialize(key_values)
  key_values.each do |k,v|
    self[k.to_sym] = v
  end
  if self[:images]
    local_images = []
    self[:images].each {|image| local_images << Image.new(image)}
    self[:images] = local_images
  end
  EME::Billing.items[self[:id]] = self
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EME::Billing::ObjectHash