Class: SmilyCli::Redaction::ScrubbedIO
- Inherits:
-
Object
- Object
- SmilyCli::Redaction::ScrubbedIO
- Defined in:
- lib/smily_cli/redaction.rb
Overview
An IO-ish wrapper that scrubs every chunk before forwarding it.
Instance Method Summary collapse
- #<<(string) ⇒ Object
- #flush ⇒ Object
-
#initialize(io) ⇒ ScrubbedIO
constructor
A new instance of ScrubbedIO.
- #print(*strings) ⇒ Object
- #puts(*strings) ⇒ Object
- #write(string) ⇒ Object
Constructor Details
#initialize(io) ⇒ ScrubbedIO
Returns a new instance of ScrubbedIO.
46 47 48 |
# File 'lib/smily_cli/redaction.rb', line 46 def initialize(io) @io = io end |
Instance Method Details
#<<(string) ⇒ Object
54 55 56 57 |
# File 'lib/smily_cli/redaction.rb', line 54 def <<(string) write(string) self end |
#flush ⇒ Object
69 70 71 |
# File 'lib/smily_cli/redaction.rb', line 69 def flush @io.flush if @io.respond_to?(:flush) end |
#print(*strings) ⇒ Object
59 60 61 62 |
# File 'lib/smily_cli/redaction.rb', line 59 def print(*strings) strings.each { |string| write(string) } nil end |