Class: Taxamatch::Parser

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

Instance Method Summary collapse

Constructor Details

#initializeParser

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_rawObject



19
20
21
# File 'lib/taxamatch_rb/parser.rb', line 19

def parsed_raw
  return @parsed_raw
end