Class: Harkness::ComicResource
- Defined in:
- lib/harkness/resources/comic.rb
Overview
The comic resource.
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#characters(comic_id:) ⇒ Harkness::CharacterDataWrapper
Get a list of characters for a particular comic.
-
#creators(comic_id:) ⇒ Harkness::CreatorDataWrapper
Get a list of creators for a particular comic.
-
#events(comic_id:) ⇒ Harkness::EventDataWrapper
Get a list of events for a particular comic.
-
#list(**params) ⇒ Harkness::ComicDataWrapper
Get a list of comics.
-
#retrieve(comic_id:) ⇒ Harkness::ComicDataWrapper
Get a single comic.
-
#stories(comic_id:) ⇒ Harkness::StoryDataWrapper
Get a list of stories for a particular comic.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Harkness::Resource
Instance Method Details
#characters(comic_id:) ⇒ Harkness::CharacterDataWrapper
Get a list of characters for a particular comic.
32 33 34 |
# File 'lib/harkness/resources/comic.rb', line 32 def characters(comic_id:) CharacterDataWrapper.from_json(get_request("comics/#{comic_id}/characters").body) end |
#creators(comic_id:) ⇒ Harkness::CreatorDataWrapper
Get a list of creators for a particular comic.
41 42 43 |
# File 'lib/harkness/resources/comic.rb', line 41 def creators(comic_id:) CreatorDataWrapper.from_json(get_request("comics/#{comic_id}/creators").body) end |
#events(comic_id:) ⇒ Harkness::EventDataWrapper
Get a list of events for a particular comic.
50 51 52 |
# File 'lib/harkness/resources/comic.rb', line 50 def events(comic_id:) EventDataWrapper.from_json(get_request("comics/#{comic_id}/events").body) end |
#list(**params) ⇒ Harkness::ComicDataWrapper
Get a list of comics.
14 15 16 |
# File 'lib/harkness/resources/comic.rb', line 14 def list(**params) ComicDataWrapper.from_json(get_request("comics", params: params).body) end |
#retrieve(comic_id:) ⇒ Harkness::ComicDataWrapper
Get a single comic.
23 24 25 |
# File 'lib/harkness/resources/comic.rb', line 23 def retrieve(comic_id:) ComicDataWrapper.from_json(get_request("comics/#{comic_id}").body) end |
#stories(comic_id:) ⇒ Harkness::StoryDataWrapper
Get a list of stories for a particular comic.
59 60 61 |
# File 'lib/harkness/resources/comic.rb', line 59 def stories(comic_id:) StoryDataWrapper.from_json(get_request("comics/#{comic_id}/stories").body) end |