Class: Marvel::Client

Inherits:
Object
  • Object
show all
Includes:
Configuration, Connection, Request
Defined in:
lib/marvel/client.rb

Constant Summary

Constants included from Connection

Marvel::Connection::BASE_API_URL, Marvel::Connection::HEADERS

Instance Attribute Summary

Attributes included from Configuration

#api_key, #private_key

Attributes included from Response

#code, #count, #etag, #limit, #offset, #status, #total

Instance Method Summary collapse

Methods included from Configuration

#configure, #reset

Methods included from Request

#get

Methods included from Response

create

Constructor Details

#initializeClient

Returns a new instance of Client.



15
16
17
# File 'lib/marvel/client.rb', line 15

def initialize
  reset
end

Instance Method Details

#character(id, options = {}) ⇒ Object

fetches a single character by id



38
39
40
41
# File 'lib/marvel/client.rb', line 38

def character(id, options = {})
  # v1/public/characters/{characterId}
  get("characters/#{id}", options)
end

#character_comics(id, options = {}) ⇒ Object

fetches lists of comics filtered by a character id



44
45
46
47
# File 'lib/marvel/client.rb', line 44

def character_comics(id, options = {})
  # v1/public/characters/{characterId}/comics
  get("characters/#{id}/comics", options)
end

#character_events(id, options = {}) ⇒ Object

fetches lists of events filtered by a character id



50
51
52
53
# File 'lib/marvel/client.rb', line 50

def character_events(id, options = {})
  # v1/public/characters/{characterId}/events
  get("characters/#{id}/events", options)
end

#character_series(id, options = {}) ⇒ Object

fetches lists of series filtered by a character id



56
57
58
59
# File 'lib/marvel/client.rb', line 56

def character_series(id, options = {})
  # vi/public/characters/{characterId}/series
  get("characters/#{id}/series", options)
end

#character_stories(id, options = {}) ⇒ Object

fetches lists of stories filtered by a character id



62
63
64
65
# File 'lib/marvel/client.rb', line 62

def character_stories(id, options = {})
  # v1/public/characters/{characterId}/stories
  get("characters/#{id}/stories", options)
end

#characters(options = {}) ⇒ Object

fetches lists of characters



32
33
34
35
# File 'lib/marvel/client.rb', line 32

def characters(options = {})
  # v1/public/characters
  get('characters', options)
end

#comic(id, options = {}) ⇒ Object

fetches a single comic by id



76
77
78
79
# File 'lib/marvel/client.rb', line 76

def comic(id, options = {})
  # v1/public/comics/{comicId}
  get("comics/#{id}", options)
end

#comic_characters(id, options = {}) ⇒ Object

fetches lists of characters filtered by a comic id



82
83
84
85
# File 'lib/marvel/client.rb', line 82

def comic_characters(id, options = {})
  # v1/public/comics/{comicId}/characters
  get("comics/#{id}/characters", options)
end

#comic_creators(id, options = {}) ⇒ Object

fetches lists of creators filtered by a comic id



88
89
90
91
# File 'lib/marvel/client.rb', line 88

def comic_creators(id, options = {})
  # v1/public/comics/{comicId}/creators
  get("comics/#{id}/creators", options)
end

#comic_events(id, options = {}) ⇒ Object

fetches lists of events filtered by a comic id



94
95
96
97
# File 'lib/marvel/client.rb', line 94

def comic_events(id, options = {})
  # v1/public/comics/{comicId}/events
  get("comics/#{id}/events", options)
end

#comic_stories(id, options = {}) ⇒ Object

fetches lists of stories filtered by a comic id



100
101
102
103
# File 'lib/marvel/client.rb', line 100

def comic_stories(id, options = {})
  # v1/public/comics/{comicId}/stories
  get("comics/#{id}/stories", options)
end

#comics(options = {}) ⇒ Object

fetches lists of comics



70
71
72
73
# File 'lib/marvel/client.rb', line 70

def comics(options = {})
  # v1/public/comics
  get('comics', options)
end

#creator(id, options = {}) ⇒ Object

fetches a single creator by id



114
115
116
117
# File 'lib/marvel/client.rb', line 114

def creator(id, options = {})
  # v1/public/creators/{creatorId}
  get("creators/#{id}", options)
end

#creator_comics(id, options = {}) ⇒ Object

fetches lists of comics filtered by a creator id



120
121
122
123
# File 'lib/marvel/client.rb', line 120

def creator_comics(id, options = {})
  # v1/public/creators/{creatorId}/comics
  get("creators/#{id}/comics", options)
end

#creator_events(id, options = {}) ⇒ Object

fetches lists of events filtered by a creator id



126
127
128
129
# File 'lib/marvel/client.rb', line 126

def creator_events(id, options = {})
  # v1/public/creators/{creatorId}/events
  get("creators/#{id}/events", options)
end

#creator_series(id, options = {}) ⇒ Object

fetches lists of series filtered by a creator id



132
133
134
135
# File 'lib/marvel/client.rb', line 132

def creator_series(id, options = {})
  # v1/public/creators/{creatorId}/series
  get("creators/#{id}/series", options)
end

#creator_stories(id, options = {}) ⇒ Object

fetches lists of stories filtered by a creator id



138
139
140
141
# File 'lib/marvel/client.rb', line 138

def creator_stories(id, options = {})
  # v1/public/creators/{creatorId}/stories
  get("creators/#{id}/stories", options)
end

#creators(options = {}) ⇒ Object

fetches lists of creators



108
109
110
111
# File 'lib/marvel/client.rb', line 108

def creators(options = {})
  # v1/public/creators
  get('creators', options)
end

#event(id, options = {}) ⇒ Object

fetches a single event by id



152
153
154
155
# File 'lib/marvel/client.rb', line 152

def event(id, options = {})
  # v1/public/events/{eventId}
  get("events/#{id}", options)
end

#event_characters(id, options = {}) ⇒ Object

fetches lists of characters filtered by an event id



158
159
160
161
# File 'lib/marvel/client.rb', line 158

def event_characters(id, options = {})
  # v1/public/events/{eventId}/characters
  get("events/#{id}/characters", options)
end

#event_comics(id, options = {}) ⇒ Object

fetches lists of comics filtered by an event id



164
165
166
167
# File 'lib/marvel/client.rb', line 164

def event_comics(id, options = {})
  # v1/public/events/{eventId}/comics
  get("events/#{id}/comics", options)
end

#event_creators(id, options = {}) ⇒ Object

fetches lists of creators filtered by an event id



170
171
172
173
# File 'lib/marvel/client.rb', line 170

def event_creators(id, options = {})
  # v1/public/events/{eventId}/creators
  get("events/#{id}/creators", options)
end

#event_series(id, options = {}) ⇒ Object

fetches lists of series filtered by an event id



176
177
178
179
# File 'lib/marvel/client.rb', line 176

def event_series(id, options = {})
  # vi/public/events/{eventId}/series
  get("events/#{id}/series", options)
end

#event_stories(id, options = {}) ⇒ Object

fetches lists of stories filtered by an event id



182
183
184
185
# File 'lib/marvel/client.rb', line 182

def event_stories(id, options = {})
  # v1/public/events/{eventId}/stories
  get("events/#{id}/stories", options)
end

#events(options = {}) ⇒ Object

fetches lists of events



146
147
148
149
# File 'lib/marvel/client.rb', line 146

def events(options = {})
  # v1/public/events
  get('events', options)
end

#serie(id, options = {}) ⇒ Object

fetches a single comic series by id



197
198
199
200
# File 'lib/marvel/client.rb', line 197

def serie(id, options = {})
  # v1/public/series/{seriesId}
  get("series/#{id}", options)
end

#series(options = {}) ⇒ Object

fetches lists of series



191
192
193
194
# File 'lib/marvel/client.rb', line 191

def series(options = {})
  # v1/public/series
  get('series', options)
end

#series_characters(id, options = {}) ⇒ Object

fetches lists of characters filtered by a series id



203
204
205
206
# File 'lib/marvel/client.rb', line 203

def series_characters(id, options = {})
  # v1/public/series/{seriesId}/characters
  get("series/#{id}/characters", options)
end

#series_comics(id, options = {}) ⇒ Object

fetches lists of comics filtered by a series id



209
210
211
212
# File 'lib/marvel/client.rb', line 209

def series_comics(id, options = {})
  # v1/public/series/{seriesId}/comics
  get("series/#{id}/comics", options)
end

#series_creators(id, options = {}) ⇒ Object

fetches lists of creators filtered by a series id



215
216
217
218
# File 'lib/marvel/client.rb', line 215

def series_creators(id, options = {})
  # v1/public/series/{seriesId}/creators
  get("series/#{id}/creators", options)
end

#series_events(id, options = {}) ⇒ Object

fetches lists of events filtered by a series id



221
222
223
224
# File 'lib/marvel/client.rb', line 221

def series_events(id, options = {})
  # v1/public/series/{seriesId}/events
  get("series/#{id}/events", options)
end

#series_stories(id, options = {}) ⇒ Object

fetches lists of stories filtered by a series id



227
228
229
230
# File 'lib/marvel/client.rb', line 227

def series_stories(id, options = {})
  # v1/public/series/{seriesId}/stories
  get("series/#{id}/stories", options)
end

#stories(options = {}) ⇒ Object

fetches lists of stories



235
236
237
238
# File 'lib/marvel/client.rb', line 235

def stories(options = {})
  # v1/public/stories
  get('stories', options)
end

#story(id, options = {}) ⇒ Object

fetches a single comic story by id



241
242
243
244
# File 'lib/marvel/client.rb', line 241

def story(id, options = {})
  # v1/public/stories/{storyId}
  get("stories/#{id}", options)
end

#story_characters(id, options = {}) ⇒ Object

fetches lists of characters filtered by a story id



247
248
249
250
# File 'lib/marvel/client.rb', line 247

def story_characters(id, options = {})
  # v1/public/stories/{storyId}/characters
  get("stories/#{id}/characters", options)
end

#story_comics(id, options = {}) ⇒ Object

fetches lists of comics filtered by a story id



253
254
255
256
# File 'lib/marvel/client.rb', line 253

def story_comics(id, options = {})
  # v1/public/stories/{storyId}/comics
  get("stories/#{id}/comics", options)
end

#story_creators(id, options = {}) ⇒ Object

fetches lists of creators filtered by a story id



259
260
261
262
# File 'lib/marvel/client.rb', line 259

def story_creators(id, options = {})
  # v1/public/stories/{storyId}/creators
  get("stories/#{id}/creators", options)
end

#story_events(id, options = {}) ⇒ Object

fetches lists of events filtered by a story id



265
266
267
268
# File 'lib/marvel/client.rb', line 265

def story_events(id, options = {})
  # v1/public/stories/{storyId}/events
  get("stories/#{id}/events", options)
end

#story_series(id, options = {}) ⇒ Object

fetches lists of series filtered by a story id



271
272
273
274
# File 'lib/marvel/client.rb', line 271

def story_series(id, options = {})
  # v1/public/stories/{storyId}/series
  get("stories/#{id}/series", options)
end