Class: Phoebe::Resources::Ref::Taxonomy::Ebird

Inherits:
Object
  • Object
show all
Defined in:
lib/phoebe/resources/ref/taxonomy/ebird.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Ebird

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Ebird.

Parameters:



45
46
47
# File 'lib/phoebe/resources/ref/taxonomy/ebird.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(cat: nil, fmt: nil, locale: nil, species: nil, version: nil, request_options: {}) ⇒ Array<Phoebe::Models::Ref::Taxonomy::EbirdRetrieveResponseItem>

Get the taxonomy used by eBird. #### Notes Each entry in the taxonomy contains a species code for example, barswa for Barn Swallow. You can download the taxonomy for selected species using the species query parameter with a comma separating each code. Otherwise the full taxonomy is downloaded.

Parameters:

  • cat (String)

    Only fetch records from these taxonomic categories.

  • fmt (Symbol, Phoebe::Models::Ref::Taxonomy::EbirdRetrieveParams::Fmt)

    Fetch the records in CSV or JSON format.

  • locale (String)

    Use this language for common names.

  • species (String)

    Only fetch records for these species.

  • version (String)

    Fetch a specific version of the taxonomy.

  • request_options (Phoebe::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/phoebe/resources/ref/taxonomy/ebird.rb', line 30

def retrieve(params = {})
  parsed, options = Phoebe::Ref::Taxonomy::EbirdRetrieveParams.dump_request(params)
  query = Phoebe::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "ref/taxonomy/ebird",
    query: query,
    model: Phoebe::Internal::Type::ArrayOf[Phoebe::Models::Ref::Taxonomy::EbirdRetrieveResponseItem],
    options: options
  )
end