Module: Biodiversity::Parser

Defined in:
lib/biodiversity/parser.rb,
lib/biodiversity/parser/gnparser.rb

Overview

Parser provides a namespace for functions to parse scientific names.

Class Method Summary collapse

Class Method Details

.parse(name, simple: false, with_cultivars: false) ⇒ Object



17
18
19
# File 'lib/biodiversity/parser.rb', line 17

def self.parse(name, simple: false, with_cultivars: false)
  (simple ? @csv_gnparser[!!with_cultivars] : @compact_gnparser[!!with_cultivars]).parse(name)
end

.parse_ary(ary, simple: false, with_cultivars: false) ⇒ Object



21
22
23
# File 'lib/biodiversity/parser.rb', line 21

def self.parse_ary(ary, simple: false, with_cultivars: false)
  (simple ? @csv_gnparser[!!with_cultivars] : @compact_gnparser[!!with_cultivars]).parse_ary(ary)
end