Class: OFX::Parser
- Inherits:
-
Object
- Object
- OFX::Parser
- Defined in:
- lib/ofx/parser.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
- #balance ⇒ Object
-
#initialize(body) ⇒ Parser
constructor
A new instance of Parser.
- #ofx_version ⇒ Object
- #pending ⇒ Object
- #transactions ⇒ Object
Constructor Details
#initialize(body) ⇒ Parser
Returns a new instance of Parser.
7 8 9 10 11 |
# File 'lib/ofx/parser.rb', line 7 def initialize(body) @body = body @output = {} dump end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/ofx/parser.rb', line 4 def body @body end |
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/ofx/parser.rb', line 5 def output @output end |
Instance Method Details
#balance ⇒ Object
21 22 23 |
# File 'lib/ofx/parser.rb', line 21 def balance @output[:balance].round(2) end |
#ofx_version ⇒ Object
13 14 15 |
# File 'lib/ofx/parser.rb', line 13 def ofx_version @body[/VERSION:([0-9]{3})/, 1].to_i end |
#pending ⇒ Object
25 26 27 |
# File 'lib/ofx/parser.rb', line 25 def pending @output[:pending].round(2) end |
#transactions ⇒ Object
17 18 19 |
# File 'lib/ofx/parser.rb', line 17 def transactions @output[:transactions] end |