Class: Phoebe::Resources::Data::Observations::Recent
- Inherits:
-
Object
- Object
- Phoebe::Resources::Data::Observations::Recent
- Defined in:
- lib/phoebe/resources/data/observations/recent.rb,
lib/phoebe/resources/data/observations/recent/notable.rb,
lib/phoebe/resources/data/observations/recent/species.rb,
lib/phoebe/resources/data/observations/recent/historic.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.
Defined Under Namespace
Classes: Historic, Notable, Species
Instance Attribute Summary collapse
-
#historic ⇒ Phoebe::Resources::Data::Observations::Recent::Historic
readonly
The data/obs end-points are used to fetch observations submitted to eBird in checklists.
-
#notable ⇒ Phoebe::Resources::Data::Observations::Recent::Notable
readonly
The data/obs end-points are used to fetch observations submitted to eBird in checklists.
-
#species ⇒ Phoebe::Resources::Data::Observations::Recent::Species
readonly
The data/obs end-points are used to fetch observations submitted to eBird in checklists.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Recent
constructor
private
A new instance of Recent.
-
#list(region_code, back: nil, cat: nil, hotspot: nil, include_provisional: nil, max_results: nil, r: nil, spp_locale: nil, request_options: {}) ⇒ Array<Phoebe::Models::Data::Observation>
Get the list of recent observations (up to 30 days ago) of birds seen in a country, state, county, or location.
Constructor Details
#initialize(client:) ⇒ Recent
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 Recent.
83 84 85 86 87 88 |
# File 'lib/phoebe/resources/data/observations/recent.rb', line 83 def initialize(client:) @client = client @notable = Phoebe::Resources::Data::Observations::Recent::Notable.new(client: client) @species = Phoebe::Resources::Data::Observations::Recent::Species.new(client: client) @historic = Phoebe::Resources::Data::Observations::Recent::Historic.new(client: client) end |
Instance Attribute Details
#historic ⇒ Phoebe::Resources::Data::Observations::Recent::Historic (readonly)
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.
35 36 37 |
# File 'lib/phoebe/resources/data/observations/recent.rb', line 35 def historic @historic end |
#notable ⇒ Phoebe::Resources::Data::Observations::Recent::Notable (readonly)
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.
19 20 21 |
# File 'lib/phoebe/resources/data/observations/recent.rb', line 19 def notable @notable end |
#species ⇒ Phoebe::Resources::Data::Observations::Recent::Species (readonly)
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.
27 28 29 |
# File 'lib/phoebe/resources/data/observations/recent.rb', line 27 def species @species end |
Instance Method Details
#list(region_code, back: nil, cat: nil, hotspot: nil, include_provisional: nil, max_results: nil, r: nil, spp_locale: nil, request_options: {}) ⇒ Array<Phoebe::Models::Data::Observation>
Get the list of recent observations (up to 30 days ago) of birds seen in a country, state, county, or location. Results include only the most recent observation for each species in the region specified.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/phoebe/resources/data/observations/recent.rb', line 64 def list(region_code, params = {}) parsed, = Phoebe::Data::Observations::RecentListParams.dump_request(params) query = Phoebe::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["data/obs/%1$s/recent", region_code], query: query.transform_keys( include_provisional: "includeProvisional", max_results: "maxResults", spp_locale: "sppLocale" ), model: Phoebe::Internal::Type::ArrayOf[Phoebe::Data::Observation], options: ) end |