Class: ACube::Support::Supplier::SupplierBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/acube/support/supplier.rb

Constant Summary collapse

@@attributes =
ACube::Schema::Header::Supplier.instance_methods.select {|m| m.ends_with?("=") && m.starts_with?(/\w/) }

Instance Method Summary collapse

Constructor Details

#initializeSupplierBuilder

Returns a new instance of SupplierBuilder.



20
21
22
# File 'lib/acube/support/supplier.rb', line 20

def initialize
  @supplier_data = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, value) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/acube/support/supplier.rb', line 28

def method_missing(method, value)
  if (@@attributes.include?(method))
    @supplier_data[method[0..-2]] = value
  else
    super 
  end
end

Instance Method Details

#finalizeObject



24
25
26
# File 'lib/acube/support/supplier.rb', line 24

def finalize
  @supplier_data
end