Class: CultomePlayer::Objects::Drive

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

Overview

The ActiveRecord model for Drive 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

#connected?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/cultome_player/objects/drive.rb', line 12

def connected?
  connected
end

#to_sObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cultome_player/objects/drive.rb', line 16

def to_s
  str = c4(":::: Drive: ")
  str += c14(self.name)
  str += c4(" => ")
  str += c14(self.songs.size.to_s)
  str += c4(" songs => ")
  str += c14(self.path)
  str += c4(" => ")
  str += connected ? c3("Online") : c2("Offline")
  str += c4(" ::::")
end