Class: PosixProxy::CaseStub

Inherits:
Object
  • Object
show all
Defined in:
lib/shell-proxy/posix/case.rb

Instance Method Summary collapse

Constructor Details

#initialize(value, &block) ⇒ CaseStub

Returns a new instance of CaseStub.



3
4
5
6
# File 'lib/shell-proxy/posix/case.rb', line 3

def initialize(value, &block)
  @value = value
  @block = block
end

Instance Method Details

#__handle(buffer) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/shell-proxy/posix/case.rb', line 8

def __handle(buffer)
  handler = CaseHandler.new(buffer)
  buffer << "case #{@value} in"
  buffer.indent
  @block.call(handler)
  buffer.undent
  buffer << "esac"
end