Class: CultomePlayer::Objects::Song

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

Overview

The ActiveRecord model for Song objects.

Instance Method Summary collapse

Methods included from Utils

#arrange_in_columns, #display, #display_over, #ensure_db_schema, #is_true_value?, #recreate_db_schema, #swallow_stdout, #to_display_list, #with_connection

Instance Method Details

#pathString

Get the full path to the song file.

Returns:

  • (String)

    The full path to the song file.



22
23
24
# File 'lib/cultome_player/objects/song.rb', line 22

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

#to_sObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/cultome_player/objects/song.rb', line 26

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

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

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