songsterr 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
data/lib/songsterr/data/base.rb
CHANGED
@@ -11,6 +11,10 @@ module Songsterr
|
|
11
11
|
@data[key.to_s.camelize(:lower)]
|
12
12
|
end
|
13
13
|
|
14
|
+
def attachment_url(key)
|
15
|
+
info(key)['attachmentUrl']
|
16
|
+
end
|
17
|
+
|
14
18
|
def method_missing(method, *args, &block)
|
15
19
|
info(method) or raise NoMethodError, "Method or attribute '#{method}' not exists on #{self.class.name}."
|
16
20
|
end
|
@@ -4,16 +4,16 @@ module Songsterr
|
|
4
4
|
module Data
|
5
5
|
class SongRevision < Base
|
6
6
|
|
7
|
-
def most_popular_track
|
8
|
-
tracks.select {|track| track.id == info(:most_popular_track)['id'] }.first
|
9
|
-
end
|
10
|
-
|
11
7
|
def tracks
|
12
8
|
@tracks ||= info(:tracks).collect {|data| Track.new(data) }
|
13
9
|
end
|
14
10
|
|
11
|
+
def most_popular_track
|
12
|
+
tracks.select {|track| track.id == info(:most_popular_track)['id'] }.first
|
13
|
+
end
|
14
|
+
|
15
15
|
def guitar_pro_tab
|
16
|
-
@guitar_pro_url ||=
|
16
|
+
@guitar_pro_url ||= attachment_url(:guitar_pro_tab)
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
data/lib/songsterr/data/track.rb
CHANGED
@@ -14,8 +14,9 @@ module Songsterr
|
|
14
14
|
@instrument ||= Instrument.new(info(:instrument))
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
17
|
+
def audio(speed=100)
|
18
18
|
@audios ||= info(:track_audios).collect {|data| TrackAudio.new(data) }
|
19
|
+
@audios.select {|audio| audio.speed == speed }.first
|
19
20
|
end
|
20
21
|
|
21
22
|
def layout_images
|