Sha256: dbbcabc54a54e3dee8c119613bbcb9113cc0aa93023a9fcf2386519148432afd

Contents?: true

Size: 413 Bytes

Versions: 6

Compression:

Stored size: 413 Bytes

Contents

module PM

# Filters are blocks of code executed by a Connection to modify incoming
# MIDI bytes. Since we want to save them to files, we store the text
# representation as well.
class Filter

  attr_accessor :block, :text

  def initialize(block, text=nil)
    @block, @text = block, text
  end

  def call(conn, bytes)
    @block.call(conn, bytes)
  end

  def to_s
    @text.gsub(/\n\s*/, "; ")
  end

end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
patchmaster-0.0.6 lib/patchmaster/filter.rb
patchmaster-0.0.5 lib/patchmaster/filter.rb
patchmaster-0.0.4 lib/patchmaster/filter.rb
patchmaster-0.0.3 lib/patchmaster/filter.rb
patchmaster-0.0.2 lib/patchmaster/filter.rb
patchmaster-0.0.1 lib/patchmaster/filter.rb