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.



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

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

Instance Method Details

#each(rs = nil) ⇒ Object



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