Class: IOWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/google_bigquery.rb

Overview

Wrapper class that abstracts which IO being used (for instance, regular files or GzipWriter.

Inspired by lib/logstash/outputs/file.rb.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ IOWriter

Returns a new instance of IOWriter.



647
648
649
# File 'lib/logstash/outputs/google_bigquery.rb', line 647

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



656
657
658
659
660
661
662
# File 'lib/logstash/outputs/google_bigquery.rb', line 656

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

#activeObject

Returns the value of attribute active.



663
664
665
# File 'lib/logstash/outputs/google_bigquery.rb', line 663

def active
  @active
end

Instance Method Details

#flushObject



653
654
655
# File 'lib/logstash/outputs/google_bigquery.rb', line 653

def flush
  @io.flush
end

#write(*args) ⇒ Object



650
651
652
# File 'lib/logstash/outputs/google_bigquery.rb', line 650

def write(*args)
  @io.write(*args)
end