Class: Shell::Echo
- Inherits:
-
BuiltInCommand
- Object
- Filter
- BuiltInCommand
- Shell::Echo
- Defined in:
- lib/shell/builtin-command.rb
Instance Attribute Summary
Attributes inherited from Filter
Instance Method Summary collapse
- #each(rs = nil) ⇒ Object
-
#initialize(sh, *strings) ⇒ Echo
constructor
A new instance of Echo.
Methods inherited from BuiltInCommand
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 |