Class: Mpc::Song

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

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Song

Returns a new instance of Song.



4
5
6
# File 'lib/mpc/song.rb', line 4

def initialize(options)
  @options = options
end

Instance Method Details

#to_sObject



8
9
10
11
12
13
14
# File 'lib/mpc/song.rb', line 8

def to_s
  if @options[:Artist].empty? || @options[:Title].empty?
    @options[:file]
  else
    "#{@options[:Artist]} - #{@options[:Title]}"
  end
end