Class: ShellWriter
- Inherits:
-
Object
- Object
- ShellWriter
- Defined in:
- lib/shell-proxy.rb
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(to) ⇒ ShellWriter
constructor
A new instance of ShellWriter.
- #puts(str) ⇒ Object
- #write(str) ⇒ Object
Constructor Details
#initialize(to) ⇒ ShellWriter
Returns a new instance of ShellWriter.
180 181 182 183 184 185 186 187 188 189 |
# File 'lib/shell-proxy.rb', line 180 def initialize(to) case to when String @to = File.open(to) when IO @to = to else raise "I don't know what to do" end end |
Instance Method Details
#flush ⇒ Object
199 200 201 |
# File 'lib/shell-proxy.rb', line 199 def flush @to.flush end |
#puts(str) ⇒ Object
195 196 197 |
# File 'lib/shell-proxy.rb', line 195 def puts(str) @to.puts(str) end |
#write(str) ⇒ Object
191 192 193 |
# File 'lib/shell-proxy.rb', line 191 def write(str) @to.write(str) end |