Class: AudioAddict::Track
- Inherits:
-
Object
- Object
- AudioAddict::Track
- Includes:
- AutoProperties, Inspectable
- Defined in:
- lib/audio_addict/track.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
Attributes included from AutoProperties
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(channel, properties) ⇒ Track
constructor
A new instance of Track.
- #inspectable ⇒ Object
- #title ⇒ Object
Methods included from Inspectable
Methods included from AutoProperties
#method_missing, #respond_to_missing?
Constructor Details
#initialize(channel, properties) ⇒ Track
Returns a new instance of Track.
8 9 10 |
# File 'lib/audio_addict/track.rb', line 8 def initialize(channel, properties) @channel, @properties = channel, properties end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class AudioAddict::AutoProperties
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
6 7 8 |
# File 'lib/audio_addict/track.rb', line 6 def channel @channel end |
Instance Method Details
#id ⇒ Object
16 17 18 |
# File 'lib/audio_addict/track.rb', line 16 def id properties['track_id'] end |
#inspectable ⇒ Object
12 13 14 |
# File 'lib/audio_addict/track.rb', line 12 def inspectable [:title, :artist, :id] end |
#title ⇒ Object
20 21 22 |
# File 'lib/audio_addict/track.rb', line 20 def title properties['title'].strip end |