Class: Egg::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/egg/parser.rb

Defined Under Namespace

Classes: UnparsableHtmlError

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Parser

Returns a new instance of Parser.



16
17
18
19
20
21
22
23
24
# File 'lib/egg/parser.rb', line 16

def initialize(html)
  if html =~ /your egg card statement/i
    @parser = StatementDocumentParser.new(html)
  elsif html =~ /egg card recent transactions/i
    @parser = RecentTransactionsDocumentParser.new(html)
  else
    raise UnparsableHtmlError
  end
end

Instance Method Details

#to_ofxObject



26
27
28
# File 'lib/egg/parser.rb', line 26

def to_ofx
  @parser.to_ofx
end