Class: ForStub
- Inherits:
-
Object
- Object
- ForStub
- Includes:
- Escaping
- Defined in:
- lib/shell-proxy/posix/for.rb
Instance Method Summary collapse
- #__handle(buffer) ⇒ Object
-
#initialize(over, iter, &block) ⇒ ForStub
constructor
A new instance of ForStub.
Methods included from Escaping
Constructor Details
#initialize(over, iter, &block) ⇒ ForStub
4 5 6 7 8 |
# File 'lib/shell-proxy/posix/for.rb', line 4 def initialize(over, iter, &block) @over = over @iter = iter @block = block end |
Instance Method Details
#__handle(buffer) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/shell-proxy/posix/for.rb', line 10 def __handle(buffer) buffer << "for #{@iter} in #{__escapinate(@over)}; do" buffer.indent @block.call buffer.undent buffer << "done" end |