Class: MonkeyMusic::Metadata::Track
- Inherits:
-
Object
- Object
- MonkeyMusic::Metadata::Track
- Defined in:
- lib/monkey_music/metadata/track.rb
Instance Attribute Summary collapse
-
#album ⇒ Object
readonly
Returns the value of attribute album.
-
#artist ⇒ Object
readonly
Returns the value of attribute artist.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Track
constructor
A new instance of Track.
- #serialize ⇒ Object
- #set_value(tier, value) ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Track
Returns a new instance of Track.
5 6 7 8 9 10 11 |
# File 'lib/monkey_music/metadata/track.rb', line 5 def initialize(args = {}) @name = args[:name] @artist = args[:artist] @album = args[:album] @year = args[:year] @uri = args[:uri] end |
Instance Attribute Details
#album ⇒ Object (readonly)
Returns the value of attribute album.
3 4 5 |
# File 'lib/monkey_music/metadata/track.rb', line 3 def album @album end |
#artist ⇒ Object (readonly)
Returns the value of attribute artist.
3 4 5 |
# File 'lib/monkey_music/metadata/track.rb', line 3 def artist @artist end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/monkey_music/metadata/track.rb', line 3 def name @name end |
#tier ⇒ Object (readonly)
Returns the value of attribute tier.
3 4 5 |
# File 'lib/monkey_music/metadata/track.rb', line 3 def tier @tier end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
3 4 5 |
# File 'lib/monkey_music/metadata/track.rb', line 3 def uri @uri end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/monkey_music/metadata/track.rb', line 3 def value @value end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
3 4 5 |
# File 'lib/monkey_music/metadata/track.rb', line 3 def year @year end |
Instance Method Details
#serialize ⇒ Object
18 19 20 |
# File 'lib/monkey_music/metadata/track.rb', line 18 def serialize "#{@name},#{@artist},#{@album},#{@year}" end |
#set_value(tier, value) ⇒ Object
13 14 15 16 |
# File 'lib/monkey_music/metadata/track.rb', line 13 def set_value(tier, value) @tier = tier @value = value end |