Class: AqBanking::Parser
- Inherits:
-
Object
- Object
- AqBanking::Parser
- Defined in:
- lib/aq_banking/parser.rb
Instance Method Summary collapse
Instance Method Details
#parse_account_list(block_str) ⇒ AqBanking::Parsed::Account
10 11 12 13 14 15 |
# File 'lib/aq_banking/parser.rb', line 10 def parse_account_list(block_str) tree = parse_block block_str tree.blocks.map do |account_block| AqBanking::Parsed::Account.new account_block end end |
#parse_block(block_str) ⇒ Object
Returns [].
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/aq_banking/parser.rb', line 19 def parse_block(block_str) parser = AccountInfoListParser.new tree = parser.parse(block_str) # If the AST is nil then there was an error during parsing # we need to report a simple error message to help the user if tree.nil? raise Errors::ParsingError.new(block_str, parser), parser.failure_reason end tree end |