Class: CultomePlayer::Objects::Song

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/cultome_player/objects/song.rb

Overview

The ActiveRecord model for Song objects.

Instance Method Summary collapse

Instance Method Details

#pathString

Get the full path to the song file.

Returns:

  • (String)

    The full path to the song file.



17
18
19
# File 'lib/cultome_player/objects/song.rb', line 17

def path
  File.join(self.drive.path, self.relative_path)
end

#to_sObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/cultome_player/objects/song.rb', line 21

def to_s
  str = c4(":::: Song: ")
  str += c10(self.name)

  unless self.artist.nil?
    str += c4(" \\ Artist: ")
    str += c11(self.artist.name)
  end

  unless self.album.nil?
    str += c4(" \\ Album: ")
    str += c13(self.album.name)
  end
  str += c4(" ::::")
end