Module: GogoKit::Client::Category

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

Overview

GogoKit::Client methods for getting categories

Instance Method Summary collapse

Methods included from Utils

#object_from_response

Instance Method Details

#get_category(category_id, options = {}) ⇒ GogoKit::Category

Retrieves a category by ID

Parameters:

  • category_id (Integer)

    The ID of the category to be retrieved

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

    Optional options

Returns:



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

def get_category(category_id, options = {})
  root = get_root
  object_from_response(GogoKit::Category,
                       GogoKit::CategoryRepresenter,
                       :get,
                       "#{root.links['self'].href}/categories/" \
                       "#{category_id}",
                       options)
end

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

Retrieves the genre categories (e.g. Sports, Concerts, Theatre)

Parameters:

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

    Optional options

Returns:

See Also:



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

def get_genres(options = {})
  object_from_response(GogoKit::PagedResource,
                       GogoKit::CategoriesRepresenter,
                       :get,
                       get_root.links['viagogo:genres'].href,
                       options)
end