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