Class: Songsterr::Data::SongRevision

Inherits:
Base
  • Object
show all
Defined in:
lib/songsterr/data/song_revision.rb

Instance Attribute Summary

Attributes inherited from Base

#data

Instance Method Summary collapse

Methods inherited from Base

#attachment_url, #info, #initialize, #method_missing

Constructor Details

This class inherits a constructor from Songsterr::Data::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Songsterr::Data::Base

Instance Method Details

#guitar_pro_tabObject



15
16
17
# File 'lib/songsterr/data/song_revision.rb', line 15

def guitar_pro_tab
  @guitar_pro_url ||= attachment_url(:guitar_pro_tab)
end


11
12
13
# File 'lib/songsterr/data/song_revision.rb', line 11

def most_popular_track
  tracks.select {|track| track.id == info(:most_popular_track)['id'] }.first
end

#tracksObject



7
8
9
# File 'lib/songsterr/data/song_revision.rb', line 7

def tracks
  @tracks ||= info(:tracks).collect {|data| Track.new(data) }
end