Sha256: 293d7f0a238f6c7d7fc6dc1cdbd52773d458da87008e037111cfd9e1021d9d82

Contents?: true

Size: 254 Bytes

Versions: 8

Compression:

Stored size: 254 Bytes

Contents

module Natour
  module BotanicalNameUtils
    module_function

    def parse(name)
      result = name.match(/^([^ ]+ [^ ]+)(( aggr\.)|(.*( subsp\. [^ ]+)))?.*$/)
      return unless result

      "#{result[1]}#{result[3]}#{result[5]}"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
natour-0.12.0 lib/natour/utils/botanical_name_utils.rb
natour-0.11.0 lib/natour/utils/botanical_name_utils.rb
natour-0.10.0 lib/natour/utils/botanical_name_utils.rb
natour-0.9.0 lib/natour/utils/botanical_name_utils.rb
natour-0.8.0 lib/natour/utils/botanical_name_utils.rb
natour-0.7.0 lib/natour/utils/botanical_name_utils.rb
natour-0.6.0 lib/natour/utils/botanical_name_utils.rb
natour-0.5.0 lib/natour/utils/botanical_name_utils.rb