Class: Harkness::CreatorResource

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

Overview

The creator 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

#comics(creator_id:) ⇒ Harkness::ComicDataWrapper

Get a list of comics for a particular creator.

Examples:

client.creators.comics(creator_id: 1234)

Parameters:

  • creator_id (Integer)

    the ID of the creator.

Returns:



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

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

#events(creator_id:) ⇒ Harkness::EventDataWrapper

Get a list of events for a particular creator.

Examples:

client.creators.events(creator_id: 1234)

Parameters:

  • creator_id (Integer)

    the ID of the creator.

Returns:



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

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

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

Get a list of creators.

Examples:

client.creators.list
client.creators.list(firstNameStartsWith: "Ben", limit: 10, orderBy: "lastName")

Parameters:

Returns:



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

def list(**params)
  CreatorDataWrapper.from_json(get_request("creators", params: params).body)
end

#retrieve(creator_id:) ⇒ Harkness::CreatorDataWrapper

Get a single creator.

Examples:

client.creators.retrieve(creator_id: 1234)

Parameters:

  • creator_id (Integer)

    the ID of the creator.

Returns:



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

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

#series(creator_id:) ⇒ Harkness::SeriesDataWrapper

Get a list of series for a particular creator.

Examples:

client.creators.series(creator_id: 1234)

Parameters:

  • creator_id (Integer)

    the ID of the creator.

Returns:



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

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

#stories(creator_id:) ⇒ Harkness::StoryDataWrapper

Get a list of stories for a particular creator.

Examples:

client.creators.stories(creator_id: 1234)

Parameters:

  • creator_id (Integer)

    the ID of the creator.

Returns:



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

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