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, #|

Constructor Details

#initialize(sh, *strings) ⇒ Echo

Returns a new instance of Echo.



26
27
28
29
# File 'lib/shell/builtin-command.rb', line 26

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

Instance Method Details

#each(rs = nil) ⇒ Object



31
32
33
34
35
36
# File 'lib/shell/builtin-command.rb', line 31

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