songkickr 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +9 -0
- data/Gemfile.lock +32 -0
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/doc/Songkickr/ArtistResult.html +44 -44
- data/doc/Songkickr/ConcertSetlistResult.html +40 -40
- data/doc/Songkickr/Event.html +48 -48
- data/doc/Songkickr/EventResult.html +42 -42
- data/doc/Songkickr/LocationResult.html +45 -45
- data/doc/Songkickr/Remote.html +45 -45
- data/doc/Songkickr/Setlist.html +41 -41
- data/doc/Songkickr.html +3 -3
- data/doc/created.rid +15 -15
- data/doc/index.html +12 -12
- data/doc/lib/songkickr/artist_rb.html +1 -1
- data/doc/lib/songkickr/artist_result_rb.html +1 -1
- data/doc/lib/songkickr/concert_setlist_result_rb.html +1 -1
- data/doc/lib/songkickr/event_rb.html +1 -1
- data/doc/lib/songkickr/event_result_rb.html +1 -1
- data/doc/lib/songkickr/location_rb.html +1 -1
- data/doc/lib/songkickr/location_result_rb.html +1 -1
- data/doc/lib/songkickr/performance_rb.html +1 -1
- data/doc/lib/songkickr/remote_rb.html +1 -1
- data/doc/lib/songkickr/setlist_item_rb.html +1 -1
- data/doc/lib/songkickr/setlist_rb.html +1 -1
- data/doc/lib/songkickr_rb.html +1 -1
- data/doc/rdoc.css +4 -0
- data/lib/songkickr/remote.rb +42 -14
- data/songkickr.gemspec +34 -9
- data/test/fixtures/venue_1276231.json +1 -0
- data/test/helper.rb +2 -0
- data/test/songkickr/test_artist.rb +4 -4
- data/test/songkickr/test_event.rb +2 -2
- data/test/songkickr/test_venue.rb +17 -0
- metadata +109 -52
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
songkickr (0.2.0)
|
5
|
+
httparty
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
crack (0.3.1)
|
11
|
+
fakeweb (1.3.0)
|
12
|
+
httparty (0.8.1)
|
13
|
+
multi_json
|
14
|
+
multi_xml
|
15
|
+
multi_json (1.1.0)
|
16
|
+
multi_xml (0.4.1)
|
17
|
+
redgreen (1.2.2)
|
18
|
+
shoulda (3.0.0)
|
19
|
+
shoulda-context (~> 1.0.0)
|
20
|
+
shoulda-matchers (~> 1.0.0)
|
21
|
+
shoulda-context (1.0.0)
|
22
|
+
shoulda-matchers (1.0.0)
|
23
|
+
|
24
|
+
PLATFORMS
|
25
|
+
ruby
|
26
|
+
|
27
|
+
DEPENDENCIES
|
28
|
+
crack
|
29
|
+
fakeweb (>= 1.3.0)
|
30
|
+
redgreen (>= 1.2.2)
|
31
|
+
shoulda (>= 2.11.0)
|
32
|
+
songkickr!
|
data/Rakefile
CHANGED
@@ -11,6 +11,8 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/jrmehle/songkickr"
|
12
12
|
gem.authors = ["Jared Mehle"]
|
13
13
|
gem.add_development_dependency "shoulda", ">= 2.11.0"
|
14
|
+
gem.add_development_dependency "fakeweb", ">= 1.3.0"
|
15
|
+
gem.add_development_dependency "redgreen", ">= 1.2.2"
|
14
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
17
|
end
|
16
18
|
Jeweler::GemcutterTasks.new
|
@@ -38,8 +40,6 @@ rescue LoadError
|
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
41
|
-
task :test => :check_dependencies
|
42
|
-
|
43
43
|
task :default => :test
|
44
44
|
|
45
45
|
require 'rake/rdoctask'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
@@ -222,101 +222,101 @@ search.</p>
|
|
222
222
|
|
223
223
|
<!-- Methods -->
|
224
224
|
|
225
|
-
<div id="
|
226
|
-
<h3 class="section-header">
|
225
|
+
<div id="public-class-method-details" class="method-section section">
|
226
|
+
<h3 class="section-header">Public Class Methods</h3>
|
227
227
|
|
228
228
|
|
229
|
-
<div id="
|
230
|
-
<a name="method-
|
229
|
+
<div id="new-method" class="method-detail ">
|
230
|
+
<a name="method-c-new"></a>
|
231
231
|
|
232
232
|
|
233
233
|
<div class="method-heading">
|
234
|
-
<span class="method-name">
|
235
|
-
class="method-args">(
|
234
|
+
<span class="method-name">new</span><span
|
235
|
+
class="method-args">(result_hash = {})</span>
|
236
236
|
<span class="method-click-advice">click to toggle source</span>
|
237
237
|
</div>
|
238
238
|
|
239
239
|
|
240
240
|
<div class="method-description">
|
241
241
|
|
242
|
-
<p>
|
243
|
-
|
244
|
-
|
245
|
-
|
242
|
+
<p>Takes the result hash directly and parses out the page and total entries
|
243
|
+
and finally passes off to the <a
|
244
|
+
href="ArtistResult.html#method-i-parse_results">parse_results</a> method to
|
245
|
+
get the results.</p>
|
246
246
|
|
247
247
|
|
248
248
|
|
249
|
-
<div class="method-source-code" id="
|
249
|
+
<div class="method-source-code" id="new-source">
|
250
250
|
<pre>
|
251
|
-
<span class="ruby-comment"># File lib/songkickr/artist_result.rb, line
|
252
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">
|
253
|
-
<span class="ruby-identifier">
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
<span class="ruby-
|
251
|
+
<span class="ruby-comment"># File lib/songkickr/artist_result.rb, line 7</span>
|
252
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">result_hash</span> = {})
|
253
|
+
<span class="ruby-identifier">results_page</span> = <span class="ruby-identifier">result_hash</span>[<span class="ruby-string">"resultsPage"</span>]
|
254
|
+
|
255
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">results_page</span>
|
256
|
+
<span class="ruby-ivar">@page</span> = <span class="ruby-identifier">results_page</span>[<span class="ruby-string">"page"</span>]
|
257
|
+
<span class="ruby-ivar">@total_entries</span> = <span class="ruby-identifier">results_page</span>[<span class="ruby-string">"totalEntries"</span>]
|
258
|
+
<span class="ruby-ivar">@results</span> = <span class="ruby-identifier">parse_results</span> <span class="ruby-identifier">results_page</span>[<span class="ruby-string">"results"</span>]
|
258
259
|
<span class="ruby-keyword">end</span>
|
259
|
-
<span class="ruby-identifier">artists</span>
|
260
260
|
<span class="ruby-keyword">end</span></pre>
|
261
|
-
</div><!--
|
261
|
+
</div><!-- new-source -->
|
262
262
|
|
263
263
|
</div>
|
264
264
|
|
265
265
|
|
266
266
|
|
267
267
|
|
268
|
-
</div><!--
|
268
|
+
</div><!-- new-method -->
|
269
269
|
|
270
270
|
|
271
|
-
</div><!--
|
271
|
+
</div><!-- public-class-method-details -->
|
272
272
|
|
273
|
-
<div id="
|
274
|
-
<h3 class="section-header">
|
273
|
+
<div id="protected-instance-method-details" class="method-section section">
|
274
|
+
<h3 class="section-header">Protected Instance Methods</h3>
|
275
275
|
|
276
276
|
|
277
|
-
<div id="
|
278
|
-
<a name="method-
|
277
|
+
<div id="parse_results-method" class="method-detail ">
|
278
|
+
<a name="method-i-parse_results"></a>
|
279
279
|
|
280
280
|
|
281
281
|
<div class="method-heading">
|
282
|
-
<span class="method-name">
|
283
|
-
class="method-args">(
|
282
|
+
<span class="method-name">parse_results</span><span
|
283
|
+
class="method-args">(results = {})</span>
|
284
284
|
<span class="method-click-advice">click to toggle source</span>
|
285
285
|
</div>
|
286
286
|
|
287
287
|
|
288
288
|
<div class="method-description">
|
289
289
|
|
290
|
-
<p>
|
291
|
-
|
292
|
-
|
293
|
-
|
290
|
+
<p>Take the results hash directly and parse the artists into <a
|
291
|
+
href="Artist.html">Artist</a> objects.</p>
|
292
|
+
|
293
|
+
<p>Returns an array of Artists.</p>
|
294
294
|
|
295
295
|
|
296
296
|
|
297
|
-
<div class="method-source-code" id="
|
297
|
+
<div class="method-source-code" id="parse_results-source">
|
298
298
|
<pre>
|
299
|
-
<span class="ruby-comment"># File lib/songkickr/artist_result.rb, line
|
300
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">
|
301
|
-
<span class="ruby-identifier">
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
<span class="ruby-
|
306
|
-
<span class="ruby-ivar">@results</span> = <span class="ruby-identifier">parse_results</span> <span class="ruby-identifier">results_page</span>[<span class="ruby-string">"results"</span>]
|
299
|
+
<span class="ruby-comment"># File lib/songkickr/artist_result.rb, line 22</span>
|
300
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">parse_results</span>(<span class="ruby-identifier">results</span> = {})
|
301
|
+
<span class="ruby-identifier">artists</span> = []
|
302
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">results</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">"artist"</span>)
|
303
|
+
<span class="ruby-identifier">results</span>[<span class="ruby-string">"artist"</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">artist</span><span class="ruby-operator">|</span>
|
304
|
+
<span class="ruby-identifier">artists</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Songkickr</span><span class="ruby-operator">::</span><span class="ruby-constant">Artist</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">artist</span>)
|
305
|
+
<span class="ruby-keyword">end</span>
|
307
306
|
<span class="ruby-keyword">end</span>
|
307
|
+
<span class="ruby-identifier">artists</span>
|
308
308
|
<span class="ruby-keyword">end</span></pre>
|
309
|
-
</div><!--
|
309
|
+
</div><!-- parse_results-source -->
|
310
310
|
|
311
311
|
</div>
|
312
312
|
|
313
313
|
|
314
314
|
|
315
315
|
|
316
|
-
</div><!--
|
316
|
+
</div><!-- parse_results-method -->
|
317
317
|
|
318
318
|
|
319
|
-
</div><!--
|
319
|
+
</div><!-- protected-instance-method-details -->
|
320
320
|
|
321
321
|
</div><!-- 5Buntitled-5D -->
|
322
322
|
|
@@ -191,99 +191,99 @@ href="http://www.songkick.com/developer/setlists">www.songkick.com/developer/set
|
|
191
191
|
|
192
192
|
<!-- Methods -->
|
193
193
|
|
194
|
-
<div id="
|
195
|
-
<h3 class="section-header">
|
194
|
+
<div id="public-class-method-details" class="method-section section">
|
195
|
+
<h3 class="section-header">Public Class Methods</h3>
|
196
196
|
|
197
197
|
|
198
|
-
<div id="
|
199
|
-
<a name="method-
|
198
|
+
<div id="new-method" class="method-detail ">
|
199
|
+
<a name="method-c-new"></a>
|
200
200
|
|
201
201
|
|
202
202
|
<div class="method-heading">
|
203
|
-
<span class="method-name">
|
204
|
-
class="method-args">(
|
203
|
+
<span class="method-name">new</span><span
|
204
|
+
class="method-args">(result_hash = {})</span>
|
205
205
|
<span class="method-click-advice">click to toggle source</span>
|
206
206
|
</div>
|
207
207
|
|
208
208
|
|
209
209
|
<div class="method-description">
|
210
210
|
|
211
|
-
<p>
|
211
|
+
<p>Takes the result ash and passes it to <a
|
212
|
+
href="ConcertSetlistResult.html#method-i-parse_results">parse_results</a></p>
|
212
213
|
|
213
214
|
|
214
215
|
|
215
|
-
<div class="method-source-code" id="
|
216
|
+
<div class="method-source-code" id="new-source">
|
216
217
|
<pre>
|
217
|
-
<span class="ruby-comment"># File lib/songkickr/concert_setlist_result.rb, line
|
218
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">
|
219
|
-
<span class="ruby-identifier">
|
220
|
-
|
221
|
-
|
222
|
-
|
218
|
+
<span class="ruby-comment"># File lib/songkickr/concert_setlist_result.rb, line 9</span>
|
219
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">result_hash</span> = {})
|
220
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">result_hash</span>[<span class="ruby-string">"resultsPage"</span>]
|
221
|
+
<span class="ruby-identifier">results_page</span> = <span class="ruby-identifier">result_hash</span>[<span class="ruby-string">"resultsPage"</span>]
|
222
|
+
|
223
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">results_page</span>
|
224
|
+
<span class="ruby-ivar">@results</span> = <span class="ruby-identifier">parse_results</span> <span class="ruby-identifier">results_page</span>[<span class="ruby-string">"results"</span>]
|
223
225
|
<span class="ruby-keyword">end</span>
|
226
|
+
<span class="ruby-keyword">else</span>
|
227
|
+
<span class="ruby-identifier">result_hash</span>
|
224
228
|
<span class="ruby-keyword">end</span>
|
225
|
-
|
226
|
-
<span class="ruby-identifier">setlists</span>
|
227
229
|
<span class="ruby-keyword">end</span></pre>
|
228
|
-
</div><!--
|
230
|
+
</div><!-- new-source -->
|
229
231
|
|
230
232
|
</div>
|
231
233
|
|
232
234
|
|
233
235
|
|
234
236
|
|
235
|
-
</div><!--
|
237
|
+
</div><!-- new-method -->
|
236
238
|
|
237
239
|
|
238
|
-
</div><!--
|
240
|
+
</div><!-- public-class-method-details -->
|
239
241
|
|
240
|
-
<div id="
|
241
|
-
<h3 class="section-header">
|
242
|
+
<div id="protected-instance-method-details" class="method-section section">
|
243
|
+
<h3 class="section-header">Protected Instance Methods</h3>
|
242
244
|
|
243
245
|
|
244
|
-
<div id="
|
245
|
-
<a name="method-
|
246
|
+
<div id="parse_results-method" class="method-detail ">
|
247
|
+
<a name="method-i-parse_results"></a>
|
246
248
|
|
247
249
|
|
248
250
|
<div class="method-heading">
|
249
|
-
<span class="method-name">
|
250
|
-
class="method-args">(
|
251
|
+
<span class="method-name">parse_results</span><span
|
252
|
+
class="method-args">(results = {})</span>
|
251
253
|
<span class="method-click-advice">click to toggle source</span>
|
252
254
|
</div>
|
253
255
|
|
254
256
|
|
255
257
|
<div class="method-description">
|
256
258
|
|
257
|
-
<p>
|
258
|
-
href="ConcertSetlistResult.html#method-i-parse_results">parse_results</a></p>
|
259
|
+
<p>Parses the setlist items into an array of SetlistItems</p>
|
259
260
|
|
260
261
|
|
261
262
|
|
262
|
-
<div class="method-source-code" id="
|
263
|
+
<div class="method-source-code" id="parse_results-source">
|
263
264
|
<pre>
|
264
|
-
<span class="ruby-comment"># File lib/songkickr/concert_setlist_result.rb, line
|
265
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">
|
266
|
-
<span class="ruby-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
<span class="ruby-ivar">@results</span> = <span class="ruby-identifier">parse_results</span> <span class="ruby-identifier">results_page</span>[<span class="ruby-string">"results"</span>]
|
265
|
+
<span class="ruby-comment"># File lib/songkickr/concert_setlist_result.rb, line 25</span>
|
266
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">parse_results</span>(<span class="ruby-identifier">results</span> = {})
|
267
|
+
<span class="ruby-identifier">setlists</span> = []
|
268
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">results</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">"setlist"</span>)
|
269
|
+
<span class="ruby-identifier">results</span>[<span class="ruby-string">"setlist"</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">setlist</span><span class="ruby-operator">|</span>
|
270
|
+
<span class="ruby-identifier">setlists</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Songkickr</span><span class="ruby-operator">::</span><span class="ruby-constant">Setlist</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">setlist</span>)
|
271
271
|
<span class="ruby-keyword">end</span>
|
272
|
-
<span class="ruby-keyword">else</span>
|
273
|
-
<span class="ruby-identifier">result_hash</span>
|
274
272
|
<span class="ruby-keyword">end</span>
|
273
|
+
|
274
|
+
<span class="ruby-identifier">setlists</span>
|
275
275
|
<span class="ruby-keyword">end</span></pre>
|
276
|
-
</div><!--
|
276
|
+
</div><!-- parse_results-source -->
|
277
277
|
|
278
278
|
</div>
|
279
279
|
|
280
280
|
|
281
281
|
|
282
282
|
|
283
|
-
</div><!--
|
283
|
+
</div><!-- parse_results-method -->
|
284
284
|
|
285
285
|
|
286
|
-
</div><!--
|
286
|
+
</div><!-- protected-instance-method-details -->
|
287
287
|
|
288
288
|
</div><!-- 5Buntitled-5D -->
|
289
289
|
|
data/doc/Songkickr/Event.html
CHANGED
@@ -413,6 +413,54 @@ href="http://www.songkick.com/developer/artist-search">www.songkick.com/develope
|
|
413
413
|
|
414
414
|
<!-- Methods -->
|
415
415
|
|
416
|
+
<div id="public-class-method-details" class="method-section section">
|
417
|
+
<h3 class="section-header">Public Class Methods</h3>
|
418
|
+
|
419
|
+
|
420
|
+
<div id="new-method" class="method-detail ">
|
421
|
+
<a name="method-c-new"></a>
|
422
|
+
|
423
|
+
|
424
|
+
<div class="method-heading">
|
425
|
+
<span class="method-name">new</span><span
|
426
|
+
class="method-args">(event_hash)</span>
|
427
|
+
<span class="method-click-advice">click to toggle source</span>
|
428
|
+
</div>
|
429
|
+
|
430
|
+
|
431
|
+
<div class="method-description">
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
<div class="method-source-code" id="new-source">
|
438
|
+
<pre>
|
439
|
+
<span class="ruby-comment"># File lib/songkickr/event.rb, line 42</span>
|
440
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">event_hash</span>)
|
441
|
+
<span class="ruby-ivar">@type</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"type"</span>]
|
442
|
+
<span class="ruby-ivar">@location</span> = <span class="ruby-constant">Songkickr</span><span class="ruby-operator">::</span><span class="ruby-constant">Location</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"location"</span>]
|
443
|
+
<span class="ruby-ivar">@status</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"status"</span>]
|
444
|
+
<span class="ruby-ivar">@display_name</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"displayName"</span>]
|
445
|
+
<span class="ruby-ivar">@venue</span> = <span class="ruby-constant">Songkickr</span><span class="ruby-operator">::</span><span class="ruby-constant">Venue</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"venue"</span>]
|
446
|
+
<span class="ruby-ivar">@start</span> = <span class="ruby-identifier">start_hash_to_datetime</span> <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"start"</span>]
|
447
|
+
<span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"uri"</span>]
|
448
|
+
<span class="ruby-ivar">@performances</span> = <span class="ruby-identifier">parse_performance</span> <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"performance"</span>]
|
449
|
+
<span class="ruby-ivar">@id</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"id"</span>]
|
450
|
+
<span class="ruby-ivar">@tickets_uri</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"ticketsUri"</span>]
|
451
|
+
<span class="ruby-keyword">end</span></pre>
|
452
|
+
</div><!-- new-source -->
|
453
|
+
|
454
|
+
</div>
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
</div><!-- new-method -->
|
460
|
+
|
461
|
+
|
462
|
+
</div><!-- public-class-method-details -->
|
463
|
+
|
416
464
|
<div id="protected-instance-method-details" class="method-section section">
|
417
465
|
<h3 class="section-header">Protected Instance Methods</h3>
|
418
466
|
|
@@ -492,54 +540,6 @@ href="http://www.songkick.com/developer/artist-search">www.songkick.com/develope
|
|
492
540
|
|
493
541
|
</div><!-- protected-instance-method-details -->
|
494
542
|
|
495
|
-
<div id="public-class-method-details" class="method-section section">
|
496
|
-
<h3 class="section-header">Public Class Methods</h3>
|
497
|
-
|
498
|
-
|
499
|
-
<div id="new-method" class="method-detail ">
|
500
|
-
<a name="method-c-new"></a>
|
501
|
-
|
502
|
-
|
503
|
-
<div class="method-heading">
|
504
|
-
<span class="method-name">new</span><span
|
505
|
-
class="method-args">(event_hash)</span>
|
506
|
-
<span class="method-click-advice">click to toggle source</span>
|
507
|
-
</div>
|
508
|
-
|
509
|
-
|
510
|
-
<div class="method-description">
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
<div class="method-source-code" id="new-source">
|
517
|
-
<pre>
|
518
|
-
<span class="ruby-comment"># File lib/songkickr/event.rb, line 42</span>
|
519
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">event_hash</span>)
|
520
|
-
<span class="ruby-ivar">@type</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"type"</span>]
|
521
|
-
<span class="ruby-ivar">@location</span> = <span class="ruby-constant">Songkickr</span><span class="ruby-operator">::</span><span class="ruby-constant">Location</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"location"</span>]
|
522
|
-
<span class="ruby-ivar">@status</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"status"</span>]
|
523
|
-
<span class="ruby-ivar">@display_name</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"displayName"</span>]
|
524
|
-
<span class="ruby-ivar">@venue</span> = <span class="ruby-constant">Songkickr</span><span class="ruby-operator">::</span><span class="ruby-constant">Venue</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"venue"</span>]
|
525
|
-
<span class="ruby-ivar">@start</span> = <span class="ruby-identifier">start_hash_to_datetime</span> <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"start"</span>]
|
526
|
-
<span class="ruby-ivar">@uri</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"uri"</span>]
|
527
|
-
<span class="ruby-ivar">@performances</span> = <span class="ruby-identifier">parse_performance</span> <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"performance"</span>]
|
528
|
-
<span class="ruby-ivar">@id</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"id"</span>]
|
529
|
-
<span class="ruby-ivar">@tickets_uri</span> = <span class="ruby-identifier">event_hash</span>[<span class="ruby-string">"ticketsUri"</span>]
|
530
|
-
<span class="ruby-keyword">end</span></pre>
|
531
|
-
</div><!-- new-source -->
|
532
|
-
|
533
|
-
</div>
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
</div><!-- new-method -->
|
539
|
-
|
540
|
-
|
541
|
-
</div><!-- public-class-method-details -->
|
542
|
-
|
543
543
|
</div><!-- 5Buntitled-5D -->
|
544
544
|
|
545
545
|
|