Class: Shell::Echo

Inherits:
BuiltInCommand show all
Defined in:
lib/shell/builtin-command.rb

Instance Attribute Summary

Attributes inherited from Filter

#input

Instance Method Summary (collapse)

Methods inherited from BuiltInCommand

#active?, #wait?

Methods inherited from Filter

#+, #<, #>, #>>, #inspect, #to_a, #to_s, #|

Methods included from Enumerable

#to_set

Constructor Details

- (Echo) initialize(sh, *strings)

A new instance of Echo



35
36
37
38
# File 'lib/shell/builtin-command.rb', line 35

def initialize(sh, *strings)
  super sh
  @strings = strings
end

Instance Method Details

- (Object) each(rs = nil)



40
41
42
43
44
45
# File 'lib/shell/builtin-command.rb', line 40

def each(rs = nil)
  rs =  @shell.record_separator unless rs
  for str  in @strings
	yield str + rs
  end
end