Class: SaltParser::Ofx::Parser::Base
- Inherits:
-
Object
- Object
- SaltParser::Ofx::Parser::Base
- Defined in:
- lib/ofx/parser/base.rb
Constant Summary collapse
- ACCOUNT_TYPES =
{ "CHECKING" => :checking, "SAVINGS" => :savings, "CREDITCARD" => :credit_card, "CREDITLINE" => :credit, "INVESTMENT" => :investment, "MONEYMRKT" => :savings }
- TRANSACTION_TYPES =
[ 'ATM', 'CASH', 'CHECK', 'CREDIT', 'DEBIT', 'DEP', 'DIRECTDEBIT', 'DIRECTDEP', 'DIV', 'FEE', 'INT', 'OTHER', 'PAYMENT', 'POS', 'REPEATPMT', 'SRVCHG', 'XFER' ].inject({}) { |hash, tran_type| hash[tran_type] = tran_type.downcase.to_sym; hash }
Instance Attribute Summary collapse
-
#accounts ⇒ Object
readonly
Returns the value of attribute accounts.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#sign_on ⇒ Object
readonly
Returns the value of attribute sign_on.
Instance Method Summary collapse
- #build_accounts ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #to_hash ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
21 22 23 24 25 26 27 28 29 |
# File 'lib/ofx/parser/base.rb', line 21 def initialize( = {}) @headers = [:headers] @body = [:body] @html = Nokogiri::HTML.parse(body) @errors = [] build_sign_on build_accounts check_for_errors end |
Instance Attribute Details
#accounts ⇒ Object (readonly)
Returns the value of attribute accounts.
19 20 21 |
# File 'lib/ofx/parser/base.rb', line 19 def accounts @accounts end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
19 20 21 |
# File 'lib/ofx/parser/base.rb', line 19 def body @body end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
19 20 21 |
# File 'lib/ofx/parser/base.rb', line 19 def errors @errors end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
19 20 21 |
# File 'lib/ofx/parser/base.rb', line 19 def headers @headers end |
#html ⇒ Object (readonly)
Returns the value of attribute html.
19 20 21 |
# File 'lib/ofx/parser/base.rb', line 19 def html @html end |
#sign_on ⇒ Object (readonly)
Returns the value of attribute sign_on.
19 20 21 |
# File 'lib/ofx/parser/base.rb', line 19 def sign_on @sign_on end |
Instance Method Details
#build_accounts ⇒ Object
39 40 41 42 43 44 |
# File 'lib/ofx/parser/base.rb', line 39 def build_accounts @accounts = Ofx::Accounts.new build_bank_account build_credit_card_account build_investments_account end |
#to_hash ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/ofx/parser/base.rb', line 31 def to_hash { :errors => errors, :sign_on => sign_on.to_hash, :accounts => accounts.to_hash } end |