Module: GogoKit::Client::Country

Includes:
Utils
Included in:
GogoKit::Client
Defined in:
lib/gogokit/client/country.rb

Overview

GogoKit::Client methods for getting countries

Instance Method Summary collapse

Methods included from Utils

#object_from_response

Instance Method Details

#get_countries(options = {}) ⇒ GogoKit::PagedResource

Retrieves all countries

Parameters:

  • options (Hash) (defaults to: {})

    Optional options

Returns:

See Also:



29
30
31
32
33
34
35
# File 'lib/gogokit/client/country.rb', line 29

def get_countries(options = {})
  object_from_response(GogoKit::PagedResource,
                       GogoKit::CountriesRepresenter,
                       :get,
                       get_root.links['viagogo:countries'].href,
                       options)
end

#get_country(code, options = {}) ⇒ GogoKit::Country

Retrieves a country by country code

Parameters:

  • code (String)

    The country code of the country to be retrieved

  • options (Hash) (defaults to: {})

    Optional options

Returns:



15
16
17
18
19
20
21
22
# File 'lib/gogokit/client/country.rb', line 15

def get_country(code, options = {})
  root = get_root
  object_from_response(GogoKit::Country,
                       GogoKit::CountryRepresenter,
                       :get,
                       "#{root.links['self'].href}/countries/#{code}",
                       options)
end