Class: ForStub

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

Instance Method Summary collapse

Methods included from Escaping

#__escapinate

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