Class: Taxamatch::Parser
- Inherits:
-
Object
- Object
- Taxamatch::Parser
- Defined in:
- lib/taxamatch_rb/parser.rb
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #parse(name) ⇒ Object
- #parsed_raw ⇒ Object
Constructor Details
#initialize ⇒ Parser
Returns a new instance of Parser.
7 8 9 10 11 |
# File 'lib/taxamatch_rb/parser.rb', line 7 def initialize @parser = ScientificNameParser.new @parsed_raw = nil @res = {} end |
Instance Method Details
#parse(name) ⇒ Object
13 14 15 16 17 |
# File 'lib/taxamatch_rb/parser.rb', line 13 def parse(name) @res = {:all_authors => [], :all_years => []} @parsed_raw = JSON.load(@parser.parse(name).to_json)['scientificName'] organize_results end |
#parsed_raw ⇒ Object
19 20 21 |
# File 'lib/taxamatch_rb/parser.rb', line 19 def parsed_raw return @parsed_raw end |