comicvine 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e57f06754f14d9c6e34e4c7bb96c9dfd7f3b5a05
4
- data.tar.gz: 3b7e8ee97f5e4201482545f1e55746376a24c3c0
3
+ metadata.gz: 3b853ef9a066f23008e9a9c8dce147714133d01c
4
+ data.tar.gz: 2dd9897234f1313c78e29439697627f8dc08dbe6
5
5
  SHA512:
6
- metadata.gz: 7ae0274f1a68527ba65c43344de16bb918d392041ea19ef79f678bd24251d9445cddf6408b974959a148fa80bfdc29607ed48738285ea6fde82261c2b178abd8
7
- data.tar.gz: 28ba70a48ca692f6d17ad15aeade62684a98f3f713bc1dcf40fc0416d5f8e24e81c5417b59edb6bb19a8e34075e20839e9958e5a3e88a6ec63921909d5269d4a
6
+ metadata.gz: 1e01d4e5a1c09b824ff07dfecf91af1b891713a96247b2bac236a261886885f6ad0c8a376fed54476cc98365b9874cd86f69b243899a82e0e5c61e15cfeeec88
7
+ data.tar.gz: c30f5d767bb36b32956858e5eba92dcc34d9cc8ed3e571da4cbd6e128ea4f896f01c5f2951e7be0ea98d385eea48a3877607ae28b4ee23923bd0af026b51f83a
Binary file
data.tar.gz.sig CHANGED
Binary file
data/Rakefile CHANGED
@@ -7,6 +7,7 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.libs << 'test'
8
8
  t.libs << 'lib'
9
9
  t.test_files = FileList['test/**/*_test.rb']
10
+ t.warning = false
10
11
  end
11
12
 
12
13
  YARD::Rake::YardocTask.new do |t|
@@ -21,7 +22,7 @@ task :default => :test
21
22
  task :gen_checksum do
22
23
  require 'digest/sha2'
23
24
  built_gem_path = 'pkg/comicvine-'+ComicVine::VERSION+'.gem'
24
- checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
25
- checksum_path = 'checksum/comicvine-'+ComicVine::VERSION+'.gem.sha512'
25
+ checksum = Digest::SHA256.new.hexdigest(File.read(built_gem_path))
26
+ checksum_path = 'checksum/comicvine-'+ComicVine::VERSION+'.gem.sha256'
26
27
  File.open(checksum_path, 'w' ) {|f| f.write(checksum) }
27
28
  end
@@ -0,0 +1 @@
1
+ 92388ee99e2c725b1375a106605187fd29bb3ebe12c1beb591cf06d7e9949e18
@@ -0,0 +1 @@
1
+ 21c5dd6f5935c7f44468fcba50e4297a66add76177f4ca9e8a48cd5edb801f89
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.bindir = 'exe'
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ['lib']
23
+ spec.required_ruby_version = '>= 2.2'
23
24
 
24
25
  spec.cert_chain = ['certs/homans.pem']
25
26
  spec.signing_key = File.expand_path('~/.ssh/gem-private_key.pem') if $0 =~ /gem\z/
@@ -59,6 +59,9 @@ module ComicVine
59
59
  # ComicVine API Key. Set to the environmental variable CV_API_KEY by default if present
60
60
  @@api_key = ENV['CV_API_KEY'] || nil
61
61
 
62
+ # Api response timeout in seconds
63
+ @@api_timeout = 10
64
+
62
65
  class << self
63
66
 
64
67
  ##
@@ -85,6 +88,22 @@ module ComicVine
85
88
  @@api_key = key
86
89
  end
87
90
 
91
+ ##
92
+ # Returns ComicVine API request timeout value
93
+ # @return [Integer]
94
+ # @since 0.1.2
95
+ def api_timeout
96
+ @@api_timeout
97
+ end
98
+
99
+ ##
100
+ # Sets the ComicVine API request timeout value in seconds
101
+ # @param seconds [Integer]
102
+ # @since 0.1.0
103
+ def api_timeout=(seconds)
104
+ @@api_timeout = seconds.to_i
105
+ end
106
+
88
107
  ##
89
108
  # Makes request for the current api version
90
109
  #
@@ -178,18 +197,18 @@ module ComicVine
178
197
  }
179
198
  ops_hash.merge! params
180
199
  resp = _make_request(resource, ops_hash)
181
- ComicVine::Resource.new(resp['results'])
200
+ ComicVine::Resource.create_resource(resp['results'])
182
201
  end
183
202
 
184
203
  ##
185
204
  # Will fetch the provided +url+ as a {ComicVine::Resource}
186
205
  # @example
187
- # ComicVine::API.get_details_by_url('http://comicvine.gamespot.com/api/issue/4000-371103')
206
+ # ComicVine::API.get_details_by_url('http://comicvine.gamespot.com/api/issue/4000-371103') #=> ComicVine::Resource::Issue
188
207
  # @param url [String]
189
208
  # @return [ComicVine::Resource]
190
209
  def get_details_by_url(url)
191
210
  resp = _make_url_request(url)
192
- ComicVine::Resource.new(resp['results'])
211
+ ComicVine::Resource::create_resource(resp['results'])
193
212
  end
194
213
 
195
214
  ##
@@ -199,8 +218,7 @@ module ComicVine
199
218
  get_list method_sym, arguments.first
200
219
  elsif find_detail(method_sym)
201
220
  get_details method_sym, *arguments
202
- elsif
203
- super
221
+ elsif super
204
222
  end
205
223
  end
206
224
 
@@ -269,11 +287,13 @@ module ComicVine
269
287
  options[:params].merge! params
270
288
 
271
289
  begin
290
+ # Sleep for 1 sec to avoid rate limit
291
+ sleep 1
272
292
  # Perform request
273
293
  request = RestClient::Request.execute(
274
294
  method: :get,
275
295
  url: url,
276
- timeout: 10,
296
+ timeout: self.api_timeout,
277
297
  headers: options
278
298
  )
279
299
  #request = RestClient.get(url, options)
@@ -53,7 +53,7 @@ module ComicVine
53
53
  super(resp)
54
54
 
55
55
  @resource = resc
56
- @cvos = resp['results'].map { |r| ComicVine::Resource.new(r) }
56
+ @cvos = resp['results'].map { |r| ComicVine::Resource.create_resource(r) }
57
57
  end
58
58
 
59
59
  def next_page
@@ -79,7 +79,7 @@ module ComicVine
79
79
 
80
80
  @resource = resc
81
81
  @query = query
82
- @cvos = resp['results'].map { |r| ComicVine::Resource.new(r) }
82
+ @cvos = resp['results'].map { |r| ComicVine::Resource.create_resource(r) }
83
83
  end
84
84
 
85
85
  ##
@@ -12,21 +12,54 @@ module ComicVine
12
12
  self.class.class_eval { attr_reader k } unless self.respond_to? k
13
13
 
14
14
  # Convert sub arrays to objects
15
- v.collect! { |i| Resource.new i } if v.kind_of?(Array) && !v.empty? && v.first.key?('api_detail_url')
15
+ v.collect! { |i| ComicVine::Resource::create_resource(i) } if v.kind_of?(Array) && !v.empty? && v.first.key?('api_detail_url')
16
16
 
17
17
  # Convert sub hashes to objects
18
- v = Resource.new v if v.kind_of?(Hash) && v.key?('api_detail_url')
18
+ if v.kind_of?(Hash) && v.key?('api_detail_url')
19
+ v = ComicVine::Resource::create_resource(v)
20
+ end
19
21
 
20
22
  # Set the instance variable to value
21
23
  instance_variable_set "@#{k}", v
22
24
  end
23
25
  end
24
26
 
27
+ ##
28
+ # Fetches data from ComicVine based on objects api_detail_url
29
+ #
25
30
  # @return [ComicVine::Resource]
31
+ # @since 0.1.0
26
32
  def fetch
27
33
  ComicVine::API.get_details_by_url(self.api_detail_url)
28
34
  end
29
35
 
36
+ ##
37
+ # Fetches data from ComicVine based on objects api_detail_url and updates self with new values
38
+ #
39
+ # @return [ComicVine::Resource]
40
+ # @since 0.1.2
41
+ def fetch!
42
+ obj = ComicVine::API.get_details_by_url(self.api_detail_url)
43
+ self.methods.each do |m|
44
+ # Look for methods that can be set (i.e. ends with a =)
45
+ if m.to_s =~ /^(?!_)([\w\d\_]+)=$/
46
+ # Save our method symbols in a more readable fashion
47
+ get_m = $1.to_sym
48
+ set_m = m
49
+
50
+ # Skip setting ids, as this should be handled by the classes when setting the children objects if needed
51
+ next if get_m.to_s =~ /\_ids?$/ || set_m.to_s =~ /attributes/
52
+
53
+ # Verify the new object has a get method and it is not nil or empty
54
+ if self.respond_to?(set_m) && obj.respond_to?(get_m) && !obj.method(get_m).call.nil?
55
+ # Now set the method to the new value
56
+ self.method(set_m).call obj.method(get_m).call
57
+ end
58
+ end
59
+ end
60
+ self
61
+ end
62
+
30
63
  # @private
31
64
  def method_missing(method_sym, *arguments, &block)
32
65
  if method_sym.to_s =~ /^get_(.*)$/
@@ -49,5 +82,75 @@ module ComicVine
49
82
  elsif super
50
83
  end
51
84
  end
85
+
86
+ ##
87
+ # Identifies objects resource type based on its ComicVine api_detail_url
88
+ #
89
+ # @return [Symbol]
90
+ # @since 0.1.2
91
+ def resource_type
92
+ ComicVine::Resource(self.api_detail_url)
93
+ end
94
+
95
+ class << self
96
+
97
+ ##
98
+ # Takes hash and returns a {ComicVine::Resource}
99
+ #
100
+ # @param attr [Hash]
101
+ # @return [ComicVine::Resource]
102
+ # @since 0.1.2
103
+ def create_resource(attr)
104
+ ComicVine::Resource.new attr
105
+ end
106
+
107
+ ##
108
+ # Parses supplied api_detail_url and returns the translated type symbol
109
+ #
110
+ # @param response [Hash]
111
+ # @return [Symbol]
112
+ # @since 0.1.2
113
+ def identify_and_update_response(response)
114
+ type = ComicVine::Resource::identify_type(response['api_detail_url'])
115
+
116
+ case type
117
+ when :first_appeared_in_issue
118
+ type = :issue
119
+ response['api_detail_url'].to_s.sub! 'first_appeared_in_issue', 'issue'
120
+ when :thing
121
+ type = :object
122
+ response['api_detail_url'].to_s.sub! 'thing', 'object'
123
+ when :creator
124
+ type = :person
125
+ response['api_detail_url'].to_s.sub! 'creator', 'person'
126
+ when :writer
127
+ type = :person
128
+ response['api_detail_url'].to_s.sub! 'writer', 'person'
129
+ when :studio
130
+ type = :publisher
131
+ response['api_detail_url'].to_s.sub! 'studio', 'publisher'
132
+ when :arc
133
+ type = :story_arc
134
+ response['api_detail_url'].to_s.sub! 'arc', 'story_arc'
135
+ else
136
+ end
137
+
138
+ type
139
+ end
140
+
141
+ ##
142
+ # Parses supplied api_detail_url and returns the translated type symbol
143
+ #
144
+ # @param api_detail_url [String]
145
+ # @return [Symbol]
146
+ # @since 0.1.2
147
+ def identify_type(api_detail_url)
148
+ if api_detail_url.to_s =~ /comicvine\.gamespot\.com\/api\/(\w+)\/?/
149
+ $1.to_s.to_sym
150
+ else
151
+ nil
152
+ end
153
+ end
154
+ end
52
155
  end
53
156
  end
@@ -1,13 +1,28 @@
1
1
  module ComicVine
2
- ##
3
- # Holds the various modules for ComicVine resource attributes
4
- # @since 0.1.0
5
- module ResourceAttributes
6
-
7
- ##
8
- # Module to hold character resource attributes
9
- # @since 0.1.0
10
- module Character
2
+ class Resource
3
+
4
+ ##
5
+ # Takes hash and returns a subclass of {ComicVine::Resource} based on identified type
6
+ #
7
+ # @example
8
+ # ComicVine::Resource.create_resource(hash) #=> #<ComicVine::Resource::Issue:0x007fa6a427bbe8>
9
+ #
10
+ # @param attr [Hash]
11
+ # @return [ComicVine::Resource]
12
+ # @since 0.1.2
13
+ def self.create_resource(attr)
14
+ type = ComicVine::Resource::identify_and_update_response(attr)
15
+ if type
16
+ Object.class_eval('ComicVine::Resource::' + type.to_s.capitalize).new attr
17
+ else
18
+ raise ScriptError, 'Unknown type for api_detail_url: ' + attr['api_detail_url']
19
+ end
20
+ end
21
+
22
+ ##
23
+ # Extends {ComicVine::Resource} to add character resource attributes
24
+ # # @since 0.1.2
25
+ class Character < ComicVine::Resource
11
26
  attr_accessor :aliases, :api_detail_url, :birth, :character_enemies, :character_friends,
12
27
  :count_of_issue_appearances, :creators, :date_added, :date_last_updated, :deck, :description,
13
28
  :first_appeared_in_issue, :gender, :id, :image, :issue_credits, :issues_died_in, :movies, :name,
@@ -16,25 +31,25 @@ module ComicVine
16
31
  end
17
32
 
18
33
  ##
19
- # Module to hold chat resource attributes
20
- # @since 0.1.0
21
- module Chat
34
+ # Extends {ComicVine::Resource} to add chat resource attributes
35
+ # @since 0.1.2
36
+ class Chat < ComicVine::Resource
22
37
  attr_accessor :api_detail_url, :channel_name, :deck, :image, :password, :site_detail_url, :title
23
38
  end
24
39
 
25
40
  ##
26
- # Module to hold concept resource attributes
27
- # @since 0.1.0
28
- module Concept
41
+ # Extends {ComicVine::Resource} to add concept resource attributes
42
+ # @since 0.1.2
43
+ class Concept < ComicVine::Resource
29
44
  attr_accessor :aliases, :api_detail_url, :count_of_issue_appearances, :date_added, :date_last_updated, :deck,
30
45
  :description, :first_appeared_in_issue, :id, :image, :issue_credits, :movies, :name,
31
46
  :site_detail_url, :start_year, :volume_credits
32
47
  end
33
48
 
34
49
  ##
35
- # Module to hold episode resource attributes
36
- # @since 0.1.0
37
- module Episode
50
+ # Extends {ComicVine::Resource} to add episode resource attributes
51
+ # @since 0.1.2
52
+ class Episode < ComicVine::Resource
38
53
  attr_accessor :aliases, :api_detail_url, :character_credits, :characters_died_in, :concept_credits, :air_date,
39
54
  :date_added, :date_last_updated, :deck, :description, :first_appearance_characters,
40
55
  :first_appearance_concepts, :first_appearance_locations, :first_appearance_objects,
@@ -44,30 +59,30 @@ module ComicVine
44
59
  end
45
60
 
46
61
  ##
47
- # Module to hold issue resource attributes
48
- # @since 0.1.0
49
- module Issue
50
- attr_accessor :aliases, :api_detail_url, :character_credits, :characters_died_in, :concept_credits, :cover_date,
62
+ # Extends {ComicVine::Resource} to add issue resource attributes
63
+ # @since 0.1.2
64
+ class Issue < ComicVine::Resource
65
+ attr_accessor :aliases, :api_detail_url, :character_credits, :character_died_in, :concept_credits, :cover_date,
51
66
  :date_added, :date_last_updated, :deck, :description, :disbanded_teams,
52
67
  :first_appearance_characters, :first_appearance_concepts, :first_appearance_locations,
53
68
  :first_appearance_objects, :first_appearance_storyarcs, :first_appearance_teams, :has_staff_review,
54
69
  :id, :image, :issue_number, :location_credits, :name, :object_credits, :person_credits,
55
- :site_detail_url, :store_date, :story_arc_credits, :team_credits, :teams_disbanded_in, :volume
70
+ :site_detail_url, :store_date, :story_arc_credits, :team_credits, :team_disbanded_in, :volume
56
71
  end
57
72
 
58
73
  ##
59
- # Module to hold location resource attributes
60
- # @since 0.1.0
61
- module Location
74
+ # Extends {ComicVine::Resource} to add location resource attributes
75
+ # @since 0.1.2
76
+ class Location < ComicVine::Resource
62
77
  attr_accessor :aliases, :api_detail_url, :count_of_issue_appearances, :date_added, :date_last_updated, :deck,
63
78
  :description, :first_appeared_in_issue, :id, :image, :issue_credits, :movies, :name,
64
79
  :site_detail_url, :start_year, :story_arc_credits, :volume_credits
65
80
  end
66
81
 
67
82
  ##
68
- # Module to hold movie resource attributes
69
- # @since 0.1.0
70
- module Movie
83
+ # Extends {ComicVine::Resource} to add movie resource attributes
84
+ # @since 0.1.2
85
+ class Movie < ComicVine::Resource
71
86
  attr_accessor :api_detail_url, :box_office_revenue, :budget, :characters, :concepts, :date_added,
72
87
  :date_last_updated, :deck, :description, :distributor, :has_staff_review, :id, :image, :locations,
73
88
  :name, :producers, :rating, :release_date, :runtime, :site_detail_url, :studios, :teams, :things,
@@ -75,75 +90,76 @@ module ComicVine
75
90
  end
76
91
 
77
92
  ##
78
- # Module to hold object resource attributes
79
- # @since 0.1.0
80
- module Object
93
+ # Extends {ComicVine::Resource} to add object resource attributes
94
+ # @since 0.1.2
95
+ class Object < ComicVine::Resource
81
96
  attr_accessor :aliases, :api_detail_url, :count_of_issue_appearances, :date_added, :date_last_updated, :deck,
82
97
  :description, :first_appeared_in_issue, :id, :image, :issue_credits, :movies, :name,
83
98
  :site_detail_url, :start_year, :story_arc_credits, :volume_credits
84
99
  end
85
100
 
86
101
  ##
87
- # Module to hold origin resource attributes
88
- # @since 0.1.0
89
- module Origin
90
- attr_accessor :api_detail_url, :character_set, :id, :name, :profiles, :site_detail_url
102
+ # Extends {ComicVine::Resource} to add origin resource attributes
103
+ # @since 0.1.2
104
+ class Origin < ComicVine::Resource
105
+ attr_accessor :api_detail_url, :character_set, :characters, :id, :name, :profiles, :site_detail_url
91
106
  end
92
107
 
93
108
  ##
94
- # Module to hold person resource attributes
95
- # @since 0.1.0
96
- module Person
109
+ # Extends {ComicVine::Resource} to add person resource attributes
110
+ # @since 0.1.2
111
+ class Person < ComicVine::Resource
97
112
  attr_accessor :aliases, :api_detail_url, :birth, :count_of_issue_appearances, :country, :created_characters,
98
113
  :date_added, :date_last_updated, :death, :deck, :description, :email, :gender, :hometown, :id,
99
114
  :image, :issue_credits, :name, :site_detail_url, :story_arc_credits, :volume_credits, :website
100
115
  end
101
116
 
102
117
  ##
103
- # Module to hold power resource attributes
104
- # @since 0.1.0
105
- module Power
106
- attr_accessor :attr_accessor, :aliases, :api_detail_url, :characters, :date_added, :date_last_updated,
118
+ # Extends {ComicVine::Resource} to add power resource attributes
119
+ # @since 0.1.2
120
+ class Power < ComicVine::Resource
121
+ attr_accessor :aliases, :api_detail_url, :characters, :date_added, :date_last_updated,
107
122
  :description, :id, :name, :site_detail_url
108
123
  end
109
124
 
110
125
  ##
111
- # Module to hold promo resource attributes
112
- # @since 0.1.0
113
- module Promo
126
+ # Extends {ComicVine::Resource} to add promo resource attributes
127
+ # @since 0.1.2
128
+ class Promo < ComicVine::Resource
114
129
  attr_accessor :api_detail_url, :date_added, :deck, :id, :image, :link, :name, :resource_type, :user
115
130
  end
116
131
 
117
132
  ##
118
- # Module to hold publisher resource attributes
119
- # @since 0.1.0
120
- module Publisher
133
+ # Extends {ComicVine::Resource} to add publisher resource attributes
134
+ # @since 0.1.2
135
+ class Publisher < ComicVine::Resource
121
136
  attr_accessor :aliases, :api_detail_url, :characters, :date_added, :date_last_updated, :deck, :description, :id,
122
137
  :image, :location_address, :location_city, :location_state, :name, :site_detail_url, :story_arcs,
123
138
  :teams, :volumes
124
139
  end
140
+
125
141
  ##
126
- # Module to hold series resource attributes
127
- # @since 0.1.0
128
- module Series
142
+ # Extends {ComicVine::Resource} to add series resource attributes
143
+ # @since 0.1.2
144
+ class Series < ComicVine::Resource
129
145
  attr_accessor :aliases, :api_detail_url, :character_credits, :count_of_episodes, :date_added, :date_last_updated,
130
146
  :deck, :description, :first_episode, :id, :image, :last_episode, :location_credits, :name,
131
147
  :publisher, :site_detail_url, :start_year
132
148
  end
133
149
 
134
150
  ##
135
- # Module to hold story_arc resource attributes
136
- # @since 0.1.0
137
- module StoryArc
151
+ # Extends {ComicVine::Resource} to add story_arc resource attributes
152
+ # @since 0.1.2
153
+ class StoryArc < ComicVine::Resource
138
154
  attr_accessor :aliases, :api_detail_url, :count_of_issue_appearances, :date_added, :date_last_updated, :deck,
139
155
  :description, :first_appeared_in_issue, :id, :image, :issues, :movies, :name, :publisher,
140
156
  :site_detail_url
141
157
  end
142
158
 
143
159
  ##
144
- # Module to hold team resource attributes
145
- # @since 0.1.0
146
- module Team
160
+ # Extends {ComicVine::Resource} to add team resource attributes
161
+ # @since 0.1.2
162
+ class Team < ComicVine::Resource
147
163
  attr_accessor :aliases, :api_detail_url, :character_enemies, :character_friends, :characters,
148
164
  :count_of_issue_appearances, :count_of_team_members, :date_added, :date_last_updated, :deck,
149
165
  :description, :disbanded_in_issues, :first_appeared_in_issue, :id, :image, :issue_credits,
@@ -152,43 +168,57 @@ module ComicVine
152
168
  end
153
169
 
154
170
  ##
155
- # Module to hold type resource attributes
156
- # @since 0.1.0
157
- module Type
171
+ # Extends {ComicVine::Resource} to add type resource attributes
172
+ # @since 0.1.2
173
+ class Type < ComicVine::Resource
158
174
  attr_accessor :detail_resource_name, :list_resource_name, :id
159
175
  end
160
176
 
161
177
  ##
162
- # Module to hold video resource attributes
163
- # @since 0.1.0
164
- module Video
178
+ # Extends {ComicVine::Resource} to add video resource attributes
179
+ # @since 0.1.2
180
+ class Video < ComicVine::Resource
165
181
  attr_accessor :api_detail_url, :deck, :hd_url, :high_url, :id, :image, :length_seconds, :low_url, :name,
166
182
  :publish_date, :site_detail_url, :url, :user
167
183
  end
168
184
 
169
185
  ##
170
- # Module to hold video_category resource attributes
171
- # @since 0.1.0
172
- module VideoCategory
186
+ # Extends {ComicVine::Resource} to add video_category resource attributes
187
+ # @since 0.1.2
188
+ class VideoCategory < ComicVine::Resource
173
189
  attr_accessor :api_detail_url, :deck, :id, :name, :site_detail_url
174
190
  end
175
191
 
176
192
  ##
177
- # Module to hold video_type resource attributes
178
- # @since 0.1.0
179
- module VideoType
193
+ # Extends {ComicVine::Resource} to add video_type resource attributes
194
+ # @since 0.1.2
195
+ class VideoType < ComicVine::Resource
180
196
  attr_accessor :api_detail_url, :deck, :id, :name, :site_detail_url
181
197
  end
182
198
 
183
199
  ##
184
- # Module to hold volume resource attributes
185
- # @since 0.1.0
186
- module Volume
200
+ # Extends {ComicVine::Resource} to add volume resource attributes
201
+ # @since 0.1.2
202
+ class Volume < ComicVine::Resource
187
203
  attr_accessor :aliases, :api_detail_url, :character_credits, :concept_credits, :count_of_issues, :date_added,
188
204
  :date_last_updated, :deck, :description, :first_issue, :id, :image, :last_issue, :location_credits,
189
205
  :name, :object_credits, :person_credits, :publisher, :site_detail_url, :start_year, :team_credits
190
206
  end
191
207
 
208
+ ##
209
+ # Extends {ComicVine::Resource} to add review resource attributes
210
+ # @since 0.1.2
211
+ class Review < ComicVine::Resource
212
+ attr_accessor :api_detail_url, :id, :name, :site_detail_url
213
+
214
+ # @private
215
+ # @since 0.1.2
216
+ def fetch
217
+ self
218
+ end
219
+
220
+ end
221
+
192
222
  end
193
223
  end
194
224
 
@@ -1,4 +1,4 @@
1
1
  module ComicVine
2
2
  # Current gem version number
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comicvine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Holden Omans
@@ -30,7 +30,7 @@ cert_chain:
30
30
  VpDNqh/BlGMQ0mqAEuBFZFSNaroph6JLUz1ykVvQENOQLThxAjolK7SAUrdoBDOc
31
31
  fXEVP1s+hpJB6IEU8/LW016TU8WpnA+MHGfJRtkrUm/cEsWU
32
32
  -----END CERTIFICATE-----
33
- date: 2016-11-09 00:00:00.000000000 Z
33
+ date: 2016-11-16 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: bundler
@@ -171,12 +171,13 @@ files:
171
171
  - bin/console
172
172
  - bin/setup
173
173
  - certs/homans.pem
174
- - checksum/comicvine-0.1.0.gem.sha512
174
+ - checksum/comicvine-0.1.0.gem.sha256
175
+ - checksum/comicvine-0.1.1.gem.sha256
175
176
  - comicvine.gemspec
176
177
  - lib/comicvine.rb
177
178
  - lib/comicvine/list.rb
178
- - lib/comicvine/modules.rb
179
179
  - lib/comicvine/resource.rb
180
+ - lib/comicvine/resource/resources.rb
180
181
  - lib/comicvine/version.rb
181
182
  homepage: https://github.com/kalinon/ruby-comicvine-api
182
183
  licenses:
@@ -190,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
191
  requirements:
191
192
  - - ">="
192
193
  - !ruby/object:Gem::Version
193
- version: '0'
194
+ version: '2.2'
194
195
  required_rubygems_version: !ruby/object:Gem::Requirement
195
196
  requirements:
196
197
  - - ">="
metadata.gz.sig CHANGED
Binary file
@@ -1 +0,0 @@
1
- 98a260c7e46e2166f400b41fc88d9da43d2f75c42712fd1f137734d20f8cebdeb101b735edb005f94cf67878d7f44c7da686775229edbc2751d0468581feed7c