Module: GogoKit::Client::Currency

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

Overview

GogoKit::Client methods for getting currencies

Instance Method Summary collapse

Methods included from Utils

#object_from_response

Instance Method Details

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

Retrieves all currencies supported by viagogo

Parameters:

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

    Optional options

Returns:

See Also:



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

def get_currencies(options = {})
  object_from_response(GogoKit::PagedResource,
                       GogoKit::CurrenciesRepresenter,
                       :get,
                       get_root.links['viagogo:currencies'].href,
                       options)
end

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

Retrieves a currency by currency code

Parameters:

  • code (String)

    The currency code of the currency to be retrieved

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

    Optional options

Returns:



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

def get_currency(code, options = {})
  root = get_root
  object_from_response(GogoKit::Currency,
                       GogoKit::CurrencyRepresenter,
                       :get,
                       "#{root.links['self'].href}/currencies/#{code}",
                       options)
end