Method: Gbif::Species.name_usage

Defined in:
lib/gbifrb/Species.rb

.name_usage(name: nil, language: nil, datasetKey: nil, sourceId: nil, limit: 100, offset: nil, verbose: nil, options: nil) ⇒ Array

Search for GBIF name usages

Examples:

require 'gbifrb'

speices = Gbif::Species
speices.name_usage(name: "Helianthus")
speices.name_usage(name: "Poa")

Parameters:

  • offset (Fixnum) (defaults to: nil)

    Number of record to start at, any non-negative integer. Default: 0

  • limit (Fixnum) (defaults to: 100)

    Number of results to return. Default: 100

  • verbose (Boolean) (defaults to: nil)

    Print request headers to stdout. Default: false

  • options (Hash) (defaults to: nil)

    Hash of options for configuring the request, passed on to Faraday.new

    • timeout [Fixnum] open/read timeout Integer in seconds

    • open_timeout [Fixnum] read timeout Integer in seconds

    • proxy [Hash] hash of proxy options

      • uri [String] Proxy Server URI

      • user [String] Proxy server username

      • password [String] Proxy server password

    • params_encoder [Hash] not sure what this is

    • bind [Hash] A hash with host and port values

    • boundary [String] of the boundary value

    • oauth [Hash] A hash with OAuth details

  • name (String) (defaults to: nil)

    Filters by a case insensitive, canonical namestring, e.g. ‘Puma concolor’

  • language (String) (defaults to: nil)

    Language, default is english

  • datasetKey (String) (defaults to: nil)

    Filters by the dataset’s key (a uuid)

  • sourceId (Fixnum) (defaults to: nil)

    Filters by the source identifier.

Returns:

  • (Array)

    An array of hashes


110
111
112
113
114
115
116
117
# File 'lib/gbifrb/Species.rb', line 110

def self.name_usage(name: nil, language: nil, datasetKey: nil, sourceId: nil,
  limit: 100, offset: nil, verbose: nil, options: nil)

  arguments = { name: name, language: language, datasetKey: datasetKey, sourceId: sourceId,
    limit: limit, offset: offset }.tostrings
  opts = arguments.delete_if { |k, v| v.nil? }
  Request.new("species/", opts, verbose, options).perform
end