Class: WhosGotDirt::Requests::Entity::Poderopedia
- Inherits:
-
WhosGotDirt::Request
- Object
- WhosGotDirt::Request
- WhosGotDirt::Requests::Entity::Poderopedia
- Defined in:
- lib/whos_got_dirt/requests/entity/poderopedia.rb
Overview
Requests for entities from the Poderopedia API.
The Poderopedia API returns 10 results only, without pagination.
The entity
filter is required.
Instance Method Summary collapse
-
#convert ⇒ Hash
Converts the MQL parameters to API-specific parameters.
-
#to_s ⇒ String
Returns the URL to request.
Constructor Details
This class inherits a constructor from WhosGotDirt::Request
Instance Method Details
#convert ⇒ Hash
Converts the MQL parameters to API-specific parameters.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/whos_got_dirt/requests/entity/poderopedia.rb', line 29 def convert match('alias', 'name') # API-specific parameters. equal('user_key', 'poderopedia_api_key') equal('entity', 'type', valid: ['Person', 'Organization'], transform: lambda{|v| case v when 'Person' 'persona' when 'Organization' 'organizacion' end }) output end |
#to_s ⇒ String
Returns the URL to request.
21 22 23 |
# File 'lib/whos_got_dirt/requests/entity/poderopedia.rb', line 21 def to_s "#{base_url}?#{to_query(convert)}" end |