Module: GogoKit::Client::Event

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

Overview

GogoKit::Client methods for getting events

Instance Method Summary collapse

Methods included from Utils

#object_from_response

Instance Method Details

#get_event(event_id, options = {}) ⇒ GogoKit::Event

Retrieves a event by ID

Parameters:

  • event_id (Integer)

    The ID of the event to be retrieved

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

    Optional options

Returns:



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

def get_event(event_id, options = {})
  root = get_root
  object_from_response(GogoKit::Event,
                       GogoKit::EventRepresenter,
                       :get,
                       "#{root.links['self'].href}/events/" \
                       "#{event_id}",
                       options)
end

#get_events_by_category(category_id, options = {}) ⇒ GogoKit::PagedResource

Retrieves all events in a particular category

Parameters:

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

    Optional options

Returns:

See Also:



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

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