Class: Song

Inherits:
Hash
  • Object
show all
Defined in:
lib/subcl/song.rb

Instance Method Summary collapse

Constructor Details

#initialize(subsonic, attributes) ⇒ Song

Returns a new instance of Song.



2
3
4
5
6
7
8
# File 'lib/subcl/song.rb', line 2

def initialize(subsonic, attributes)
  @subsonic = subsonic
  self['type'] = 'song'
  attributes.each do |key, val|
    self[key] = val
  end
end

Instance Method Details

#urlObject

returns the streaming url for a song



11
12
13
# File 'lib/subcl/song.rb', line 11

def url
  @subsonic.song_url(self['id'])
end