Sha256: db00e71e41c651204db4cd68bc7223f348b2f6d51d026c2b4b61aa4266db5ad4

Contents?: true

Size: 402 Bytes

Versions: 9

Compression:

Stored size: 402 Bytes

Contents

module Music
module Transcription

class Change
  class Immediate < Change
    def pack
      [ @value ]
    end
  end
  
  class Gradual < Change
    def pack
      [ @value, @duration ]
    end
  end

  def self.unpack packing
    case packing.size
    when 1 then Immediate.new(*packing)
    when 2 then Gradual.new(*packing)
    else raise ArgumentError, "bad array size"
    end
  end
end

end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
music-transcription-0.21.0 lib/music-transcription/packing/change_packing.rb
music-transcription-0.20.0 lib/music-transcription/packing/change_packing.rb
music-transcription-0.19.0 lib/music-transcription/packing/change_packing.rb
music-transcription-0.17.1 lib/music-transcription/packing/change_packing.rb
music-transcription-0.17.0 lib/music-transcription/packing/change_packing.rb
music-transcription-0.16.0 lib/music-transcription/packing/change_packing.rb
music-transcription-0.15.0 lib/music-transcription/packing/change_packing.rb
music-transcription-0.14.0 lib/music-transcription/packing/change_packing.rb
music-transcription-0.13.0 lib/music-transcription/packing/change_packing.rb