Class: Marvel::Client
- Inherits:
-
Object
- Object
- Marvel::Client
- Includes:
- Configuration, Connection, Request
- Defined in:
- lib/marvel/client.rb
Instance Attribute Summary
Attributes included from Configuration
Instance Method Summary collapse
-
#get_character(id) ⇒ Object
fetches a single character by id.
-
#get_characters ⇒ Object
fetches lists of characters.
-
#get_characters_by_comic_id(id) ⇒ Object
fetches lists of characters filtered by a comic id.
-
#get_characters_by_event_id(id) ⇒ Object
fetches lists of characters filtered by an event id.
-
#get_characters_by_series_id(id) ⇒ Object
fetches lists of characters filtered by a series id.
-
#get_characters_by_story_id(id) ⇒ Object
fetches lists of characters filtered by a story id.
-
#get_comic(id) ⇒ Object
fetches a single comic by id.
-
#get_comics ⇒ Object
fetches lists of comics.
-
#get_comics_by_character_id(id) ⇒ Object
fetches lists of comics filtered by a character id.
-
#get_comics_by_creator_id(id) ⇒ Object
fetches lists of comics filtered by a creator id.
-
#get_comics_by_event_id(id) ⇒ Object
fetches lists of comics filtered by an event id.
-
#get_comics_by_series_id(id) ⇒ Object
fetches lists of comics filtered by a series id.
-
#get_comics_by_story_id(id) ⇒ Object
fetches lists of comics filtered by a story id.
-
#get_creator(id) ⇒ Object
fetches a single creator by id.
-
#get_creators ⇒ Object
fetches lists of creators.
-
#get_creators_by_comic_id(id) ⇒ Object
fetches lists of creators filtered by a comic id.
-
#get_creators_by_event_id(id) ⇒ Object
fetches lists of creators filtered by an event id.
-
#get_creators_by_series_id(id) ⇒ Object
fetches lists of creators filtered by a series id.
-
#get_creators_by_story_id(id) ⇒ Object
fetches lists of creators filtered by a story id.
-
#get_event(id) ⇒ Object
fetches a single event by id.
-
#get_events ⇒ Object
fetches lists of events.
-
#get_events_by_character_id(id) ⇒ Object
fetches lists of events filtered by a character id.
-
#get_events_by_comic_id(id) ⇒ Object
fetches lists of events filtered by a comic id.
-
#get_events_by_creator_id(id) ⇒ Object
fetches lists of events filtered by a creator id.
-
#get_events_by_series_id(id) ⇒ Object
fetches lists of events filtered by a series id.
-
#get_events_by_story_id(id) ⇒ Object
fetches lists of events filtered by a story id.
-
#get_series ⇒ Object
fetches lists of series.
-
#get_series_by_id(id) ⇒ Object
fetches a single comic series by id.
-
#get_stories ⇒ Object
fetches lists of stories.
-
#get_stories_by_character_id(id) ⇒ Object
fetches lists of stories filtered by a character id.
-
#get_stories_by_comic_id(id) ⇒ Object
fetches lists of stories filtered by a comic id.
-
#get_stories_by_creator_id(id) ⇒ Object
fetches lists of stories filtered by a creator id.
-
#get_stories_by_event_id(id) ⇒ Object
fetches lists of stories filtered by an event id.
-
#get_stories_by_series_id(id) ⇒ Object
fetches lists of stories filtered by a series id.
-
#get_story(id) ⇒ Object
fetches a single comic story by id.
-
#initialize ⇒ Client
constructor
BASE_URL = ‘gateway.marvel.com/v1/public/’.
Methods included from Configuration
Methods included from Request
Constructor Details
#initialize ⇒ Client
BASE_URL = ‘gateway.marvel.com/v1/public/’
17 18 19 |
# File 'lib/marvel/client.rb', line 17 def initialize reset end |
Instance Method Details
#get_character(id) ⇒ Object
fetches a single character by id
39 40 41 42 43 |
# File 'lib/marvel/client.rb', line 39 def get_character(id) # v1/public/characters/{characterId} Faraday.get("#{BASE_URL}characters/#{id}#{auth}").body # get("characters/#{id}#{auth}") end |
#get_characters ⇒ Object
fetches lists of characters
34 35 36 |
# File 'lib/marvel/client.rb', line 34 def get_characters # v1/public/characters end |
#get_characters_by_comic_id(id) ⇒ Object
fetches lists of characters filtered by a comic id
77 78 79 80 |
# File 'lib/marvel/client.rb', line 77 def get_characters_by_comic_id(id) # v1/public/comics/{comicId}/characters Faraday.get("#{BASE_URL}comics/#{id}/characters#{auth}").body end |
#get_characters_by_event_id(id) ⇒ Object
fetches lists of characters filtered by an event id
145 146 147 148 |
# File 'lib/marvel/client.rb', line 145 def get_characters_by_event_id(id) # v1/public/events/{eventId}/characters Faraday.get("#{BASE_URL}events/#{id}/characters#{auth}").body end |
#get_characters_by_series_id(id) ⇒ Object
fetches lists of characters filtered by a series id
183 184 185 186 |
# File 'lib/marvel/client.rb', line 183 def get_characters_by_series_id(id) # v1/public/series/{seriesId}/characters Faraday.get("#{BASE_URL}series/#{id}/characters#{auth}").body end |
#get_characters_by_story_id(id) ⇒ Object
fetches lists of characters filtered by a story id
226 227 228 229 |
# File 'lib/marvel/client.rb', line 226 def get_characters_by_story_id(id) # v1/public/stories/{storyId}/characters Faraday.get("#{BASE_URL}stories/#{id}/characters#{auth}").body end |
#get_comic(id) ⇒ Object
fetches a single comic by id
71 72 73 74 |
# File 'lib/marvel/client.rb', line 71 def get_comic(id) # v1/public/comics/{comicId} Faraday.get("#{BASE_URL}comics/#{id}#{auth}").body end |
#get_comics ⇒ Object
fetches lists of comics
66 67 68 |
# File 'lib/marvel/client.rb', line 66 def get_comics # v1/public/comics end |
#get_comics_by_character_id(id) ⇒ Object
fetches lists of comics filtered by a character id
46 47 48 49 |
# File 'lib/marvel/client.rb', line 46 def get_comics_by_character_id(id) # v1/public/characters/{characterId}/comics Faraday.get("#{BASE_URL}characters/#{id}/comics#{auth}").body end |
#get_comics_by_creator_id(id) ⇒ Object
fetches lists of comics filtered by a creator id
114 115 116 117 |
# File 'lib/marvel/client.rb', line 114 def get_comics_by_creator_id(id) # v1/public/creators/{creatorId}/comics Faraday.get("#{BASE_URL}creators/#{id}/comics#{auth}").body end |
#get_comics_by_event_id(id) ⇒ Object
fetches lists of comics filtered by an event id
151 152 153 154 |
# File 'lib/marvel/client.rb', line 151 def get_comics_by_event_id(id) # v1/public/events/{eventId}/comics Faraday.get("#{BASE_URL}events/#{id}/comics#{auth}").body end |
#get_comics_by_series_id(id) ⇒ Object
fetches lists of comics filtered by a series id
189 190 191 192 |
# File 'lib/marvel/client.rb', line 189 def get_comics_by_series_id(id) # v1/public/series/{seriesId}/comics Faraday.get("#{BASE_URL}series/#{id}/comics#{auth}").body end |
#get_comics_by_story_id(id) ⇒ Object
fetches lists of comics filtered by a story id
232 233 234 235 |
# File 'lib/marvel/client.rb', line 232 def get_comics_by_story_id(id) # v1/public/stories/{storyId}/comics Faraday.get("#{BASE_URL}stories/#{id}/comics#{auth}").body end |
#get_creator(id) ⇒ Object
fetches a single creator by id
108 109 110 111 |
# File 'lib/marvel/client.rb', line 108 def get_creator(id) # v1/public/creators/{creatorId} Faraday.get("#{BASE_URL}creators/#{id}#{auth}").body end |
#get_creators ⇒ Object
fetches lists of creators
103 104 105 |
# File 'lib/marvel/client.rb', line 103 def get_creators # v1/public/creators end |
#get_creators_by_comic_id(id) ⇒ Object
fetches lists of creators filtered by a comic id
83 84 85 86 |
# File 'lib/marvel/client.rb', line 83 def get_creators_by_comic_id(id) # v1/public/comics/{comicId}/creators Faraday.get("#{BASE_URL}comics/#{id}/creators#{auth}").body end |
#get_creators_by_event_id(id) ⇒ Object
fetches lists of creators filtered by an event id
157 158 159 160 |
# File 'lib/marvel/client.rb', line 157 def get_creators_by_event_id(id) # v1/public/events/{eventId}/creators Faraday.get("#{BASE_URL}events/#{id}/creators#{auth}").body end |
#get_creators_by_series_id(id) ⇒ Object
fetches lists of creators filtered by a series id
195 196 197 198 |
# File 'lib/marvel/client.rb', line 195 def get_creators_by_series_id(id) # v1/public/series/{seriesId}/creators Faraday.get("#{BASE_URL}series/#{id}/creators#{auth}").body end |
#get_creators_by_story_id(id) ⇒ Object
fetches lists of creators filtered by a story id
238 239 240 241 |
# File 'lib/marvel/client.rb', line 238 def get_creators_by_story_id(id) # v1/public/stories/{storyId}/creators Faraday.get("#{BASE_URL}stories/#{id}/creators#{auth}").body end |
#get_event(id) ⇒ Object
fetches a single event by id
139 140 141 142 |
# File 'lib/marvel/client.rb', line 139 def get_event(id) # v1/public/events/{eventId} Faraday.get("#{BASE_URL}events/#{id}#{auth}").body end |
#get_events ⇒ Object
fetches lists of events
134 135 136 |
# File 'lib/marvel/client.rb', line 134 def get_events # v1/public/events end |
#get_events_by_character_id(id) ⇒ Object
fetches lists of events filtered by a character id
52 53 54 55 |
# File 'lib/marvel/client.rb', line 52 def get_events_by_character_id(id) # v1/public/characters/{characterId}/events Faraday.get("#{BASE_URL}characters/#{id}/events#{auth}").body end |
#get_events_by_comic_id(id) ⇒ Object
fetches lists of events filtered by a comic id
89 90 91 92 |
# File 'lib/marvel/client.rb', line 89 def get_events_by_comic_id(id) # v1/public/comics/{comicId}/events Faraday.get("#{BASE_URL}comics/#{id}/events#{auth}").body end |
#get_events_by_creator_id(id) ⇒ Object
fetches lists of events filtered by a creator id
120 121 122 123 |
# File 'lib/marvel/client.rb', line 120 def get_events_by_creator_id(id) # v1/public/creators/{creatorId}/events Faraday.get("#{BASE_URL}creators/#{id}/events#{auth}").body end |
#get_events_by_series_id(id) ⇒ Object
fetches lists of events filtered by a series id
201 202 203 204 |
# File 'lib/marvel/client.rb', line 201 def get_events_by_series_id(id) # v1/public/series/{seriesId}/events Faraday.get("#{BASE_URL}series/#{id}/events#{auth}").body end |
#get_events_by_story_id(id) ⇒ Object
fetches lists of events filtered by a story id
244 245 246 247 |
# File 'lib/marvel/client.rb', line 244 def get_events_by_story_id(id) # v1/public/stories/{storyId}/events Faraday.get("#{BASE_URL}stories/#{id}/events#{auth}").body end |
#get_series ⇒ Object
fetches lists of series
172 173 174 |
# File 'lib/marvel/client.rb', line 172 def get_series # v1/public/series end |
#get_series_by_id(id) ⇒ Object
fetches a single comic series by id
177 178 179 180 |
# File 'lib/marvel/client.rb', line 177 def get_series_by_id(id) # v1/public/series/{seriesId} Faraday.get("#{BASE_URL}series/#{id}#{auth}").body end |
#get_stories ⇒ Object
fetches lists of stories
215 216 217 |
# File 'lib/marvel/client.rb', line 215 def get_stories # v1/public/stories end |
#get_stories_by_character_id(id) ⇒ Object
fetches lists of stories filtered by a character id
58 59 60 61 |
# File 'lib/marvel/client.rb', line 58 def get_stories_by_character_id(id) # v1/public/characters/{characterId}/stories Faraday.get("#{BASE_URL}characters/#{id}/stories#{auth}").body end |
#get_stories_by_comic_id(id) ⇒ Object
fetches lists of stories filtered by a comic id
95 96 97 98 |
# File 'lib/marvel/client.rb', line 95 def get_stories_by_comic_id(id) # v1/public/comics/{comicId}/stories Faraday.get("#{BASE_URL}comics/#{id}/stories#{auth}").body end |
#get_stories_by_creator_id(id) ⇒ Object
fetches lists of stories filtered by a creator id
126 127 128 129 |
# File 'lib/marvel/client.rb', line 126 def get_stories_by_creator_id(id) # v1/public/creators/{creatorId}/stories Faraday.get("#{BASE_URL}creators/#{id}/stories#{auth}").body end |
#get_stories_by_event_id(id) ⇒ Object
fetches lists of stories filtered by an event id
163 164 165 166 |
# File 'lib/marvel/client.rb', line 163 def get_stories_by_event_id(id) # v1/public/events/{eventId}/stories Faraday.get("#{BASE_URL}events/#{id}/stories#{auth}").body end |
#get_stories_by_series_id(id) ⇒ Object
fetches lists of stories filtered by a series id
207 208 209 210 |
# File 'lib/marvel/client.rb', line 207 def get_stories_by_series_id(id) # v1/public/series/{seriesId}/stories Faraday.get("#{BASE_URL}series/#{id}/stories#{auth}").body end |
#get_story(id) ⇒ Object
fetches a single comic story by id
220 221 222 223 |
# File 'lib/marvel/client.rb', line 220 def get_story(id) # v1/public/stories/{storyId} Faraday.get("#{BASE_URL}stories/#{id}#{auth}").body end |