Class: Harkness::EventResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/harkness/resources/event.rb

Overview

The event resource.

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Harkness::Resource

Instance Method Details

#characters(event_id:) ⇒ Harkness::CharaacterDataWrapper

Get a list of characters for a particular event.

Examples:

client.events.characters(event_id: 1234)

Parameters:

  • event_id (Integer)

    the ID of the event.

Returns:

  • (Harkness::CharaacterDataWrapper)

    the top level wrapper around the event API response.



59
60
61
# File 'lib/harkness/resources/event.rb', line 59

def characters(event_id:)
  CharacterDataWrapper.from_json(get_request("events/#{event_id}/characters").body)
end

#comics(event_id:) ⇒ Harkness::ComicDataWrapper

Get a list of comics for a particular event.

Examples:

client.events.comics(event_id: 1234)

Parameters:

  • event_id (Integer)

    the ID of the event.

Returns:



32
33
34
# File 'lib/harkness/resources/event.rb', line 32

def comics(event_id:)
  ComicDataWrapper.from_json(get_request("events/#{event_id}/comics").body)
end

#creators(event_id:) ⇒ Harkness::CreatorDataWrapper

Get a list of creators for a particular event.

Examples:

client.events.creators(event_id: 1234)

Parameters:

  • event_id (Integer)

    the ID of the event.

Returns:



68
69
70
# File 'lib/harkness/resources/event.rb', line 68

def creators(event_id:)
  CreatorDataWrapper.from_json(get_request("events/#{event_id}/creators").body)
end

#list(**params) ⇒ Harkness::EventDataWrapper

Get a list of events.

Examples:

client.events.list
client.events.list(nameStartsWith: "2016", limit: 10, orderBy: "-name")

Parameters:

Returns:



14
15
16
# File 'lib/harkness/resources/event.rb', line 14

def list(**params)
  EventDataWrapper.from_json(get_request("events", params: params).body)
end

#retrieve(event_id:) ⇒ Harkness::EventDataWrapper

Get a single event.

Examples:

client.events.retrieve(event_id: 1234)

Parameters:

  • event_id (Integer)

    the ID of the event.

Returns:



23
24
25
# File 'lib/harkness/resources/event.rb', line 23

def retrieve(event_id:)
  EventDataWrapper.from_json(get_request("events/#{event_id}").body)
end

#series(event_id:) ⇒ Harkness::SeriesDataWrapper

Get a list of series for a particular event.

Examples:

client.events.series(event_id: 1234)

Parameters:

  • event_id (Integer)

    the ID of the event.

Returns:



41
42
43
# File 'lib/harkness/resources/event.rb', line 41

def series(event_id:)
  SeriesDataWrapper.from_json(get_request("events/#{event_id}/series").body)
end

#stories(event_id:) ⇒ Harkness::StoryDataWrapper

Get a list of stories for a particular event.

Examples:

client.events.stories(event_id: 1234)

Parameters:

  • event_id (Integer)

    the ID of the event.

Returns:



50
51
52
# File 'lib/harkness/resources/event.rb', line 50

def stories(event_id:)
  StoryDataWrapper.from_json(get_request("events/#{event_id}/stories").body)
end