Class: IOWriter
- Inherits:
-
Object
- Object
- IOWriter
- Defined in:
- lib/logstash/outputs/file.rb
Overview
wrapper class
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(io) ⇒ IOWriter
constructor
A new instance of IOWriter.
- #method_missing(method_name, *args, &block) ⇒ Object
- #write(*args) ⇒ Object
Constructor Details
#initialize(io) ⇒ IOWriter
Returns a new instance of IOWriter.
237 238 239 |
# File 'lib/logstash/outputs/file.rb', line 237 def initialize(io) @io = io end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
250 251 252 253 254 255 256 |
# File 'lib/logstash/outputs/file.rb', line 250 def method_missing(method_name, *args, &block) if @io.respond_to?(method_name) @io.send(method_name, *args, &block) else super end end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
257 258 259 |
# File 'lib/logstash/outputs/file.rb', line 257 def active @active end |
Instance Method Details
#flush ⇒ Object
244 245 246 247 248 249 |
# File 'lib/logstash/outputs/file.rb', line 244 def flush @io.flush if @io.class == Zlib::GzipWriter @io.to_io.flush end end |
#write(*args) ⇒ Object
240 241 242 243 |
# File 'lib/logstash/outputs/file.rb', line 240 def write(*args) @io.write(*args) @active = true end |