Class: MT940::StatementLineBundle

Inherits:
Object
  • Object
show all
Defined in:
lib/mt940/customer_statement_message.rb

Constant Summary collapse

METHOD_MAP =
{
  :amount                   => :line,
  :funds_code               => :line,
  :value_date               => :line,
  :entry_date               => :line,
  :account_holder           => :info,
  :details                  => :info,
  :account_number           => :info,
  :bank_code                => :info,
  :code                     => :info,
  :transaction_description  => :info,
}

Instance Method Summary collapse

Constructor Details

#initialize(statement_line, statement_line_info) ⇒ StatementLineBundle

Returns a new instance of StatementLineBundle.



61
62
63
# File 'lib/mt940/customer_statement_message.rb', line 61

def initialize(statement_line, statement_line_info)
  @line, @info = statement_line, statement_line_info
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



65
66
67
68
69
# File 'lib/mt940/customer_statement_message.rb', line 65

def method_missing(method, *args, &block)
  super unless METHOD_MAP.has_key?(method)
  object = instance_variable_get("@#{METHOD_MAP[method.to_sym]}")
  object.send(method)
end