Class: Phoebe::Resources::Data::Observations::Recent::Notable
- Inherits:
-
Object
- Object
- Phoebe::Resources::Data::Observations::Recent::Notable
- Defined in:
- lib/phoebe/resources/data/observations/recent/notable.rb
Overview
The data/obs end-points are used to fetch observations submitted to eBird in checklists. There are two categories of end-point: 1. Fetch observations for a specific country, region or location. 2. Fetch observations for nearby locations - up to a distance of 50km. Each end-point supports optional query parameters which allow you to filter the list of observations returned.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Notable
constructor
private
A new instance of Notable.
-
#list(region_code, back: nil, detail: nil, hotspot: nil, max_results: nil, r: nil, spp_locale: nil, request_options: {}) ⇒ Array<Phoebe::Models::Data::Observation>
Get the list of recent, notable observations (up to 30 days ago) of birds seen in a country, region or location.
Constructor Details
#initialize(client:) ⇒ Notable
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 Notable.
55 56 57 |
# File 'lib/phoebe/resources/data/observations/recent/notable.rb', line 55 def initialize(client:) @client = client end |
Instance Method Details
#list(region_code, back: nil, detail: nil, hotspot: nil, max_results: nil, r: nil, spp_locale: nil, request_options: {}) ⇒ Array<Phoebe::Models::Data::Observation>
Get the list of recent, notable observations (up to 30 days ago) of birds seen in a country, region or location. Notable observations can be for locally or nationally rare species or are otherwise unusual, e.g. over-wintering birds in a species which is normally only a summer visitor.
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/phoebe/resources/data/observations/recent/notable.rb', line 40 def list(region_code, params = {}) parsed, = Phoebe::Data::Observations::Recent::NotableListParams.dump_request(params) query = Phoebe::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["data/obs/%1$s/recent/notable", region_code], query: query.transform_keys(max_results: "maxResults", spp_locale: "sppLocale"), model: Phoebe::Internal::Type::ArrayOf[Phoebe::Data::Observation], options: ) end |