Class: Cmxl::Fields::VmkSummary
Constant Summary
Constants inherited
from Cmxl::Field
Cmxl::Field::DATE
Instance Attribute Summary
Attributes inherited from Cmxl::Field
#data, #match, #modifier, #source, #tag
Instance Method Summary
collapse
Methods inherited from Cmxl::Field
#add_meta_data, #initialize, #method_missing, parse, parsers, #to_amount, #to_amount_in_cents, #to_date, #to_hash, #to_json
Constructor Details
This class inherits a constructor from Cmxl::Field
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Cmxl::Field
Instance Method Details
#amount ⇒ Object
19
20
21
|
# File 'lib/cmxl/fields/vmk_summary.rb', line 19
def amount
to_amount(data['amount'])
end
|
#credit? ⇒ Boolean
7
8
9
|
# File 'lib/cmxl/fields/vmk_summary.rb', line 7
def credit?
modifier == 'C'
end
|
#debit? ⇒ Boolean
11
12
13
|
# File 'lib/cmxl/fields/vmk_summary.rb', line 11
def debit?
modifier == 'D'
end
|
#entries ⇒ Object
15
16
17
|
# File 'lib/cmxl/fields/vmk_summary.rb', line 15
def entries
data['entries'].to_i
end
|
#to_h ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/cmxl/fields/vmk_summary.rb', line 23
def to_h
{
type: debit? ? 'debit' : 'credit',
entries: entries,
amount: amount,
currency: currency
}
end
|