Class: INatGet::Data::Helper::Places Private
- Inherits:
-
INatGet::Data::Helper
- Object
- INatGet::Data::Helper
- INatGet::Data::Helper::Places
- Includes:
- Singleton
- Defined in:
- lib/inat-get/data/helpers/places.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary
Constants inherited from INatGet::Data::Helper
Instance Method Summary collapse
- #endpoint ⇒ Object private
- #query_to_api(**query) ⇒ Array<Hash> private
Methods inherited from INatGet::Data::Helper
#definitions, field, fields, #manager, #prepare_query, #query_to_sequel, #validate_query!
Instance Method Details
#endpoint ⇒ Object
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.
12 |
# File 'lib/inat-get/data/helpers/places.rb', line 12 def endpoint() = :places |
#query_to_api(**query) ⇒ Array<Hash>
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.
18 19 20 21 22 23 |
# File 'lib/inat-get/data/helpers/places.rb', line 18 def query_to_api **query endpoint = self.manager.endpoint values = (query[:id] || []).to_set + (query[:slug] || []).to_set blocks = values.each_slice(200).to_a blocks.map { |v| { endpoint: "#{ endpoint }/#{ v.map(&:to_s).join(',') }", query: {} } } end |