Class: Shell::AppendIO
- Inherits:
-
BuiltInCommand
- Object
- Filter
- BuiltInCommand
- Shell::AppendIO
- Defined in:
- lib/shell/builtin-command.rb
Overview
class Sort < Cat
def initialize(sh, *filenames)
super
end
def each(rs = nil)
ary = []
super{|l| ary.push l}
for l in ary.sort!
yield l
end
end
end
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Filter
Instance Method Summary collapse
-
#initialize(sh, io, filter) ⇒ AppendIO
constructor
A new instance of AppendIO.
- #input=(filter) ⇒ Object
Methods inherited from BuiltInCommand
Methods inherited from Filter
#+, #<, #>, #>>, #each, #inspect, #to_a, #to_s, #|
Constructor Details
#initialize(sh, io, filter) ⇒ AppendIO
Returns a new instance of AppendIO.
101 102 103 104 105 |
# File 'lib/shell/builtin-command.rb', line 101 def initialize(sh, io, filter) super sh @input = filter @io = io end |
Instance Method Details
#input=(filter) ⇒ Object
107 108 109 110 111 112 |
# File 'lib/shell/builtin-command.rb', line 107 def input=(filter) @input.input=filter for l in @input @io << l end end |