Class: PosixProxy::CaseStub
- Inherits:
-
Object
- Object
- PosixProxy::CaseStub
- Defined in:
- lib/shell-proxy/posix/case.rb
Instance Method Summary collapse
- #__handle(buffer) ⇒ Object
-
#initialize(value, &block) ⇒ CaseStub
constructor
A new instance of CaseStub.
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 |