Class: LilyPlaying::Current

Inherits:
Object
  • Object
show all
Defined in:
lib/lilyplaying/current.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Current

Returns a new instance of Current.



5
6
7
# File 'lib/lilyplaying/current.rb', line 5

def initialize(data)
  @data = data
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



9
10
11
# File 'lib/lilyplaying/current.rb', line 9

def method_missing(meth, *args, &block)
  @data[meth.to_s]
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/lilyplaying/current.rb', line 3

def data
  @data
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/lilyplaying/current.rb', line 13

def to_s
  "#{name} - #{artist}"
end