Class: LilyPlaying::Current
- Inherits:
-
Object
- Object
- LilyPlaying::Current
- Defined in:
- lib/lilyplaying/current.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Current
constructor
A new instance of Current.
- #method_missing(meth, *args, &block) ⇒ Object
- #to_s ⇒ Object
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
#data ⇒ Object (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_s ⇒ Object
13 14 15 |
# File 'lib/lilyplaying/current.rb', line 13 def to_s "#{name} - #{artist}" end |