Class: ACube::Support::Customer::CustomerBuilder

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

Constant Summary collapse

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

Instance Method Summary collapse

Constructor Details

#initializeCustomerBuilder

Returns a new instance of CustomerBuilder.



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

def initialize
  @customer_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/customer.rb', line 28

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

Instance Method Details

#finalizeObject



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

def finalize
  @customer_data
end