Sha256: 48ed8b34ca073083531741717524656c1da00466717a922a96ed781440d98685

Contents?: true

Size: 322 Bytes

Versions: 7

Compression:

Stored size: 322 Bytes

Contents

class Kommando::Buffer

  def initialize
    @buffer = []

    @matchers = {}
  end

  def append(string)
    @buffer << string
  end

  def to_s
    @buffer.join ""
  end

  def <<(string)
    @buffer << string
  end

  def getc
    @buffer.shift
  end

  def on(matcher, &block)
    @matchers[matcher] = block
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kommando-0.0.19 lib/kommando/buffer.rb
kommando-0.0.18 lib/kommando/buffer.rb
kommando-0.0.17 lib/kommando/buffer.rb
kommando-0.0.16 lib/kommando/buffer.rb
kommando-0.0.15 lib/kommando/buffer.rb
kommando-0.0.13 lib/kommando/buffer.rb
kommando-0.0.12 lib/kommando/buffer.rb