Sha256: 58fce87942333a668d15bb643a3be55dafcee5202404e74c69a37bc31ca5d59f

Contents?: true

Size: 810 Bytes

Versions: 2

Compression:

Stored size: 810 Bytes

Contents

module Traktor
  module NML
    class Track
      attr_reader :title, :artist, :album,
        :primarykey,
        :genre, :label, :release_date,
        :playtime, :bpm, :key, :musical_key,
        :cues

      def initialize(info)
        @title        = info[:title]
        @artist       = info[:artist]
        @album        = info[:album]
        @primarykey   = info[:primarykey]
        @genre        = info[:genre]
        @label        = info[:label]
        @release_date = info[:release_date]
        @playtime     = info[:playtime]
        @bpm          = info[:bpm]
        @key          = info[:key]
        @musical_key  = info[:musical_key]
        @cues         = info[:cues]
      end

      def [](key)
        return self.instance_variable_get("@#{key.to_s}")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
traktor-nml-0.3.1 lib/traktor/nml/track.rb
traktor-nml-0.3.0 lib/traktor/nml/track.rb