Class: ACube::Support::Transaction::TransactionBuilder

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

Constant Summary collapse

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

Instance Method Summary collapse

Constructor Details

#initializeTransactionBuilder

Returns a new instance of TransactionBuilder.



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

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

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

Instance Method Details

#finalizeObject



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

def finalize
  @transaction_data
end