Class: Phoebe::Resources::Product::Stats
- Inherits:
-
Object
- Object
- Phoebe::Resources::Product::Stats
- Defined in:
- lib/phoebe/resources/product/stats.rb
Overview
The product end-points make it easy to get the information shown in various pages on the eBird web site: 1. The Top 100 contributors on a given date. 2. The checklists submitted on a given date. 3. The most recent checklists submitted. 4. A summary of the checklists submitted on a given date. 5. The details and all the observations of a checklist.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Stats
constructor
private
A new instance of Stats.
-
#retrieve(d, region_code:, y_:, m:, request_options: {}) ⇒ Phoebe::Models::Product::StatRetrieveResponse
Get a summary of the number of checklist submitted, species seen and contributors on a given date for a country or region.
Constructor Details
#initialize(client:) ⇒ Stats
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 Stats.
57 58 59 |
# File 'lib/phoebe/resources/product/stats.rb', line 57 def initialize(client:) @client = client end |
Instance Method Details
#retrieve(d, region_code:, y_:, m:, request_options: {}) ⇒ Phoebe::Models::Product::StatRetrieveResponse
Get a summary of the number of checklist submitted, species seen and contributors on a given date for a country or region.
#### Notes The results are updated every 15 minutes.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/phoebe/resources/product/stats.rb', line 32 def retrieve(d, params) parsed, = Phoebe::Product::StatRetrieveParams.dump_request(params) region_code = parsed.delete(:region_code) do raise ArgumentError.new("missing required path argument #{_1}") end y_ = parsed.delete(:y_) do raise ArgumentError.new("missing required path argument #{_1}") end m = parsed.delete(:m) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["product/stats/%1$s/%2$s/%3$s/%4$s", region_code, y_, m, d], model: Phoebe::Models::Product::StatRetrieveResponse, options: ) end |