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