Class: Musk::Track

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

Constant Summary collapse

ATTRIBUTES =
[
  :loadpath,
  :fullpath,
  :title,
  :number,
  :number_of,
  :artist,
  :release,
  :genre,
  :year,
  :comment,
]

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Track

Returns a new instance of Track.



18
19
20
# File 'lib/musk/track.rb', line 18

def initialize(attributes = {})
  attributes.each { |k, v| send("#{k}=", v) if respond_to?("#{k}=") }
end

Instance Method Details

#attributesObject



22
23
24
# File 'lib/musk/track.rb', line 22

def attributes
  Hash[ATTRIBUTES.map { |a| [a, send("#{a}")] }]
end