metal_archives 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e5c9e464d998ad27ebce937a23a7b9924ccf871
4
- data.tar.gz: 758ebce5c4bb742680622b18c0fb5b3138a077c3
3
+ metadata.gz: 28427a784c317b61bcf01f503f193773f7ab8854
4
+ data.tar.gz: 1fdafac6af5df82d1cd1de9c02a9e3357297a160
5
5
  SHA512:
6
- metadata.gz: b5c26112b01a3de24352096e0f3dc2b6a7394cd7a9ae0bf4f7607f8ec057668ca6cc5bd30dda216547128dff8c38f141463472645b2623b1507c13b9bf8fd5e2
7
- data.tar.gz: 1848ff7bef54f75f913e7212b7c18b9e97c216ec3e8ce86f5b3b90e8c632614d9408b5cf43089b76de045e2591e472264b9d9bc9aa99e00f0f7c94f661dd5f69
6
+ metadata.gz: 41f50843c789d298d6b123c2571bae112d2f656d420d1db36bff4c9d4d64437800ff58d0332e207a605c9c07954881eec4faaa06a58454a0ef7325ecbc00fc13
7
+ data.tar.gz: 581f8c2e7ebc7bacc8d687b9a7a69db25ac2e579518aa3c66c5fa4ff3c22a739f8b89d17b31ce70b4f949f13aae9b5b51a64257955b14346a067f6769a8c8d56
data/README.md CHANGED
@@ -73,7 +73,9 @@ Refer to the model's [RDoc documentation](https://floriandejonckheere.github.io/
73
73
 
74
74
  ## Lazy loading
75
75
 
76
- By default when an model (Artist, Band, ...) is created, no data is fetched. This leads to instantiation of a model with an invalid ID not throwing any errors. Calling any attribute other than `id` will cause all data to be fetched and any errors to be thrown. Refer to the respective methods to find out what errors are thrown in what circumstances.
76
+ By default when an model (Artist, Band, ...) is created, no data is fetched. This leads to instantiation of a model with an invalid ID not throwing any errors. Calling any attribute other than `id` will cause all data to be fetched and any errors to be thrown. Refer to the respective methods to find out what errors are thrown in what circumstances.
77
+
78
+ Models can be forced to load all data by calling the `:load!` method.
77
79
 
78
80
  ## Testing
79
81
  ```
@@ -10,7 +10,7 @@ require 'metal_archives/models/label'
10
10
  require 'metal_archives/models/artist'
11
11
  require 'metal_archives/models/band'
12
12
 
13
- require 'metal_archives/parsers/parser_helper'
13
+ require 'metal_archives/parsers/parser'
14
14
  require 'metal_archives/parsers/label'
15
15
  require 'metal_archives/parsers/artist'
16
16
  require 'metal_archives/parsers/band'
@@ -13,7 +13,8 @@ module MetalArchives
13
13
  # A block must be specified, to which a
14
14
  # rdoc-ref:MetalArchives::Configuration parameter will be passed.
15
15
  #
16
- # Raises rdoc-ref:InvalidConfigurationException
16
+ # [Raises]
17
+ # - rdoc-ref:InvalidConfigurationException
17
18
  #
18
19
  def configure
19
20
  raise MetalArchives::Errors::InvalidConfigurationError, 'No configuration block given' unless block_given?
@@ -12,8 +12,12 @@ module MetalArchives
12
12
  ##
13
13
  # Retrieve a HTTP resource
14
14
  #
15
+ # [Raises]
16
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when receiving a status code == 404n
17
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
18
+ #
15
19
  def get(*params)
16
- response = client.get *params
20
+ response = client.get(*params)
17
21
 
18
22
  raise Errors::InvalidIDError, response.status if response.status == 404
19
23
  raise Errors::APIError, response.status if response.status >= 400
@@ -27,6 +31,7 @@ module MetalArchives
27
31
  ##
28
32
  # Retrieve a HTTP client
29
33
  #
34
+ #
30
35
  def client
31
36
  raise Errors::InvalidConfigurationError, 'Not configured yet' unless MetalArchives.config
32
37
 
@@ -6,7 +6,7 @@ module MetalArchives
6
6
  ##
7
7
  # Represents a single performer (but not a solo artist)
8
8
  #
9
- class Artist < BaseModel
9
+ class Artist < MetalArchives::BaseModel
10
10
  ##
11
11
  # :attr_reader: id
12
12
  #
@@ -19,8 +19,9 @@ module MetalArchives
19
19
  #
20
20
  # Returns +String+
21
21
  #
22
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
23
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
22
+ # [Raises]
23
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
24
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
24
25
  #
25
26
  property :name
26
27
 
@@ -29,8 +30,9 @@ module MetalArchives
29
30
  #
30
31
  # Returns +Array+ of +String+
31
32
  #
32
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
33
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
33
+ # [Raises]
34
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
35
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
34
36
  #
35
37
  property :aliases, :multiple => true
36
38
 
@@ -39,8 +41,9 @@ module MetalArchives
39
41
  #
40
42
  # Returns +ISO3166::Country+
41
43
  #
42
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
43
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
44
+ # [Raises]
45
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
46
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
44
47
  #
45
48
  property :country, :type => ISO3166::Country
46
49
 
@@ -49,8 +52,9 @@ module MetalArchives
49
52
  #
50
53
  # Returns +String+
51
54
  #
52
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
53
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
55
+ # [Raises]
56
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
57
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
54
58
  #
55
59
  property :location
56
60
 
@@ -59,8 +63,9 @@ module MetalArchives
59
63
  #
60
64
  # Returns +Date+
61
65
  #
62
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
63
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
66
+ # [Raises]
67
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
68
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
64
69
  #
65
70
  property :date_of_birth, :type => Date
66
71
 
@@ -69,8 +74,9 @@ module MetalArchives
69
74
  #
70
75
  # Returns +Date+
71
76
  #
72
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
73
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
77
+ # [Raises]
78
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
79
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
74
80
  #
75
81
  property :date_of_death, :type => Date
76
82
 
@@ -79,8 +85,9 @@ module MetalArchives
79
85
  #
80
86
  # Returns +String+
81
87
  #
82
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
83
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
88
+ # [Raises]
89
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
90
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
84
91
  #
85
92
  property :cause_of_death
86
93
 
@@ -89,8 +96,9 @@ module MetalArchives
89
96
  #
90
97
  # Returns +Symbol+, either +:male+ or +:female+
91
98
  #
92
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
93
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
99
+ # [Raises]
100
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
101
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
94
102
  #
95
103
  enum :gender, :values => [:male, :female]
96
104
 
@@ -99,8 +107,9 @@ module MetalArchives
99
107
  #
100
108
  # Returns raw HTML +String+
101
109
  #
102
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
103
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
110
+ # [Raises]
111
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
112
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
104
113
  #
105
114
  property :biography
106
115
 
@@ -109,8 +118,9 @@ module MetalArchives
109
118
  #
110
119
  # Returns raw HTML +String+
111
120
  #
112
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
113
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
121
+ # [Raises]
122
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
123
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
114
124
  #
115
125
  property :trivia
116
126
 
@@ -119,8 +129,9 @@ module MetalArchives
119
129
  #
120
130
  # Returns +Array+ of +Hash+ containing the following keys
121
131
  #
122
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
123
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
132
+ # [Raises]
133
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
134
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
124
135
  #
125
136
  # [+similar+]
126
137
  # - +:url+: +String+
@@ -138,8 +149,9 @@ module MetalArchives
138
149
  ##
139
150
  # Fetch the data and assemble the model
140
151
  #
141
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when receiving a status code == 404
142
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
152
+ # [Raises]
153
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
154
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
143
155
  #
144
156
  def assemble # :nodoc:
145
157
  ## Base attributes
@@ -187,15 +199,17 @@ module MetalArchives
187
199
  #
188
200
  # Returns rdoc-ref:Band
189
201
  #
190
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
191
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
202
+ # [Raises]
203
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
204
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
205
+ # - rdoc-ref:MetalArchives::Errors::ParserError when parsing failed. Please report this error.
192
206
  #
193
207
  # [+id+]
194
208
  # +Integer+
195
209
  #
196
210
  def find!(id)
197
211
  obj = find id
198
- obj.send :fetch
212
+ obj.load!
199
213
 
200
214
  obj
201
215
  end
@@ -205,7 +219,9 @@ module MetalArchives
205
219
  #
206
220
  # Returns rdoc-ref:Artist or nil when no results
207
221
  #
208
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
222
+ # [Raises]
223
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
224
+ # - rdoc-ref:MetalArchives::Errors::ParserError when parsing failed. Please report this error.
209
225
  #
210
226
  # [+query+]
211
227
  # Hash containing one or more of the following keys:
@@ -231,7 +247,9 @@ module MetalArchives
231
247
  #
232
248
  # Returns rdoc-ref:Collection of rdoc-ref:Artist
233
249
  #
234
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
250
+ # [Raises]
251
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
252
+ # - rdoc-ref:MetalArchives::Errors::ParserError when parsing failed. Please report this error.
235
253
  #
236
254
  # [+name+]
237
255
  # +String+
@@ -6,7 +6,7 @@ module MetalArchives
6
6
  ##
7
7
  # Represents an band (person or group)
8
8
  #
9
- class Band < BaseModel
9
+ class Band < MetalArchives::BaseModel
10
10
  ##
11
11
  # :attr_reader: id
12
12
  #
@@ -19,8 +19,9 @@ module MetalArchives
19
19
  #
20
20
  # Returns +String+
21
21
  #
22
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
23
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
22
+ # [Raises]
23
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
24
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
24
25
  #
25
26
  property :name
26
27
 
@@ -29,8 +30,9 @@ module MetalArchives
29
30
  #
30
31
  # Returns +Array+ of +String+
31
32
  #
32
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
33
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
33
+ # [Raises]
34
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
35
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
34
36
  #
35
37
  property :aliases, :multiple => true
36
38
 
@@ -39,8 +41,9 @@ module MetalArchives
39
41
  #
40
42
  # Returns +ISO3166::Country+
41
43
  #
42
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
43
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
44
+ # [Raises]
45
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
46
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
44
47
  #
45
48
  property :country, :type => ISO3166::Country
46
49
 
@@ -49,8 +52,9 @@ module MetalArchives
49
52
  #
50
53
  # Returns +String+
51
54
  #
52
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
53
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
55
+ # [Raises]
56
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
57
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
54
58
  #
55
59
  property :location
56
60
 
@@ -59,8 +63,9 @@ module MetalArchives
59
63
  #
60
64
  # Returns +Date+
61
65
  #
62
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
63
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
66
+ # [Raises]
67
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
68
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
64
69
  #
65
70
  property :date_formed, :type => Date
66
71
 
@@ -69,8 +74,9 @@ module MetalArchives
69
74
  #
70
75
  # Returns +Array+ of rdoc-ref:Range
71
76
  #
72
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
73
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
77
+ # [Raises]
78
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
79
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
74
80
  #
75
81
  property :date_active, :type => MetalArchives::Range, :multiple => true
76
82
 
@@ -79,8 +85,9 @@ module MetalArchives
79
85
  #
80
86
  # Returns +Array+ of +String+
81
87
  #
82
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
83
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
88
+ # [Raises]
89
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
90
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
84
91
  #
85
92
  property :genres, :multiple => true
86
93
 
@@ -89,8 +96,9 @@ module MetalArchives
89
96
  #
90
97
  # Returns +Array+ of +String+
91
98
  #
92
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
93
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
99
+ # [Raises]
100
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
101
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
94
102
  #
95
103
  property :lyrical_themes, :multiple => true
96
104
 
@@ -99,8 +107,9 @@ module MetalArchives
99
107
  #
100
108
  # Returns rdoc-ref:Label
101
109
  #
102
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
103
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
110
+ # [Raises]
111
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
112
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
104
113
  #
105
114
  property :label, :type => MetalArchives::Label
106
115
 
@@ -109,8 +118,9 @@ module MetalArchives
109
118
  #
110
119
  # Returns boolean
111
120
  #
112
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
113
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
121
+ # [Raises]
122
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
123
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
114
124
  #
115
125
  enum :independent, :values => [true, false]
116
126
 
@@ -119,8 +129,9 @@ module MetalArchives
119
129
  #
120
130
  # Returns raw HTML +String+
121
131
  #
122
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
123
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
132
+ # [Raises]
133
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
134
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
124
135
  #
125
136
  property :comment
126
137
 
@@ -129,8 +140,9 @@ module MetalArchives
129
140
  #
130
141
  # Returns +:active+, +:split_up+, +:on_hold+, +:unknown+, +:changed_name+ or +:disputed+
131
142
  #
132
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
133
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
143
+ # [Raises]
144
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
145
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
134
146
  #
135
147
  enum :status, :values => [:active, :split_up, :on_hold, :unknown, :changed_name, :disputed]
136
148
 
@@ -142,8 +154,9 @@ module MetalArchives
142
154
  #
143
155
  # Returns +Array+ of +Hash+ containing the following keys
144
156
  #
145
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
146
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
157
+ # [Raises]
158
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
159
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
147
160
  #
148
161
  # [+similar+]
149
162
  # - +:band+: rdoc-ref:Band
@@ -156,8 +169,9 @@ module MetalArchives
156
169
  #
157
170
  # Returns +String+
158
171
  #
159
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
160
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
172
+ # [Raises]
173
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
174
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
161
175
  #
162
176
  property :logo
163
177
 
@@ -166,8 +180,9 @@ module MetalArchives
166
180
  #
167
181
  # Returns +String+
168
182
  #
169
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
170
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
183
+ # [Raises]
184
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
185
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
171
186
  #
172
187
  property :photo
173
188
 
@@ -176,8 +191,9 @@ module MetalArchives
176
191
  #
177
192
  # Returns +Array+ of +Hash+ containing the following keys
178
193
  #
179
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
180
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
194
+ # [Raises]
195
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
196
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
181
197
  #
182
198
  # [+similar+]
183
199
  # - +:url+: +String+
@@ -190,8 +206,9 @@ module MetalArchives
190
206
  ##
191
207
  # Fetch the data and assemble the model
192
208
  #
193
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when receiving a status code == 404
194
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
209
+ # [Raises]
210
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when receiving a status code == 404
211
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
195
212
  #
196
213
  def assemble # :nodoc:
197
214
  ## Base attributes
@@ -239,15 +256,17 @@ module MetalArchives
239
256
  #
240
257
  # Returns rdoc-ref:Band
241
258
  #
242
- # Raises rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
243
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
259
+ # [Raises]
260
+ # - rdoc-ref:MetalArchives::Errors::InvalidIDError when no or invalid id
261
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
262
+ # - rdoc-ref:MetalArchives::Errors::ParserError when parsing failed. Please report this error.
244
263
  #
245
264
  # [+id+]
246
265
  # +Integer+
247
266
  #
248
267
  def find!(id)
249
268
  obj = find id
250
- obj.send :fetch
269
+ obj.load!
251
270
 
252
271
  obj
253
272
  end
@@ -259,7 +278,9 @@ module MetalArchives
259
278
  #
260
279
  # Returns rdoc-ref:Band or nil when no results
261
280
  #
262
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
281
+ # [Raises]
282
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
283
+ # - rdoc-ref:MetalArchives::Errors::ParserError when parsing failed. Please report this error.
263
284
  #
264
285
  # [+query+]
265
286
  # Hash containing one or more of the following keys:
@@ -299,7 +320,9 @@ module MetalArchives
299
320
  #
300
321
  # Returns rdoc-ref:Collection of rdoc-ref:Band
301
322
  #
302
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
323
+ # [Raises]
324
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
325
+ # - rdoc-ref:MetalArchives::Errors::ParserError when parsing failed. Please report this error.
303
326
  #
304
327
  # [+query+]
305
328
  # Hash containing one or more of the following keys:
@@ -353,7 +376,8 @@ module MetalArchives
353
376
  #
354
377
  # Returns (possibly empty) +Array+ of rdoc-ref:Band
355
378
  #
356
- # Raises rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
379
+ # [Raises]
380
+ # - rdoc-ref:MetalArchives::Errors::APIError when receiving a status code >= 400
357
381
  #
358
382
  # [+name+]
359
383
  # +String+