Class: MonkeyMusic::Metadata::Track

Inherits:
Object
  • Object
show all
Defined in:
lib/monkey_music/metadata/track.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#albumObject (readonly)

Returns the value of attribute album.



3
4
5
# File 'lib/monkey_music/metadata/track.rb', line 3

def album
  @album
end

#artistObject (readonly)

Returns the value of attribute artist.



3
4
5
# File 'lib/monkey_music/metadata/track.rb', line 3

def artist
  @artist
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/monkey_music/metadata/track.rb', line 3

def name
  @name
end

#tierObject (readonly)

Returns the value of attribute tier.



3
4
5
# File 'lib/monkey_music/metadata/track.rb', line 3

def tier
  @tier
end

#uriObject (readonly)

Returns the value of attribute uri.



3
4
5
# File 'lib/monkey_music/metadata/track.rb', line 3

def uri
  @uri
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/monkey_music/metadata/track.rb', line 3

def value
  @value
end

#yearObject (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

#serializeObject



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