Class: Harkness::SeriesResource

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

Overview

The series 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(series_id:) ⇒ Harkness::CharacterDataWrapper

Get a list of characters for a particular series.

Examples:

client.series.characters(series_id: 1234)

Parameters:

  • series_id (Integer)

    the ID of the series.

Returns:



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

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

#comics(series_id:) ⇒ Harkness::ComicDataWrapper

Get a list of comics for a particular series.

Examples:

client.series.comics(series_id: 1234)

Parameters:

  • series_id (Integer)

    the ID of the series.

Returns:



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

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

#creators(series_id:) ⇒ Harkness::CreatorDataWrapper

Get a list of creators for a particular series.

Examples:

client.series.creators(series_id: 1234)

Parameters:

  • series_id (Integer)

    the ID of the series.

Returns:



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

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

#events(series_id:) ⇒ Harkness::EventDataWrapper

Get a list of events for a particular series.

Examples:

client.series.events(series_id: 1234)

Parameters:

  • series_id (Integer)

    the ID of the series.

Returns:



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

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

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

Get a list of series.

Examples:

client.series.list
client.series.list(titleStartsWith: "Ant-", limit: 10, orderBy: "title")

Parameters:

Returns:



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

def list(**params)
  SeriesDataWrapper.from_json(get_request("series", params: params).body)
end

#retrieve(series_id:) ⇒ Harkness::SeriesDataWrapper

Get a single series.

Examples:

client.series.retrieve(series_id: 1234)

Parameters:

  • series_id (Integer)

    the ID of the series.

Returns:



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

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

#stories(series_id:) ⇒ Harkness::StoryDataWrapper

Get a list of stories for a particular series.

Examples:

client.series.stories(series_id: 1234)

Parameters:

  • series_id (Integer)

    the ID of the series.

Returns:



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

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