Class: WhosGotDirt::Requests::List::LittleSis

Inherits:
WhosGotDirt::Request show all
Defined in:
lib/whos_got_dirt/requests/list/little_sis.rb

Overview

Requests for lists from the LittleSis API.

The q parameter matches names and descriptions.

Examples:

Supply an API key.

"little_sis_api_key": "..."

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from WhosGotDirt::Request

Instance Method Details

#convertHash

Converts the MQL parameters to API-specific parameters.

Returns:

  • (Hash)

    API-specific parameters

See Also:



25
26
27
28
29
30
31
32
33
34
# File 'lib/whos_got_dirt/requests/list/little_sis.rb', line 25

def convert
  match('q', 'name')
  equal('num', 'limit') # default 100, maximum 100
  equal('page', 'page')

  # API-specific parameters.
  equal('_key', 'little_sis_api_key')

  output
end

#to_sString

Returns the URL to request.

Returns:

  • (String)

    the URL to request



17
18
19
# File 'lib/whos_got_dirt/requests/list/little_sis.rb', line 17

def to_s
  "#{base_url}?#{to_query(convert)}"
end