Class: LogStash::Outputs::Gcs::PathFactoryBuilder

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

Overview

PathFactoryBuilder makes the long PathFactory constructor chain more readable.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build {|builder| ... } ⇒ Object

Yields:

  • (builder)


99
100
101
102
103
# File 'lib/logstash/outputs/gcs/path_factory.rb', line 99

def self.build
  builder = new
  yield builder
  builder.build_path_factory
end

.builder_setter(*names) ⇒ Object



105
106
107
108
109
# File 'lib/logstash/outputs/gcs/path_factory.rb', line 105

def self.builder_setter(*names)
  names.each do |name|
    define_method("set_#{name}") {|arg| instance_variable_set("@#{name}", arg)}
  end
end

Instance Method Details

#build_path_factoryObject



113
114
115
# File 'lib/logstash/outputs/gcs/path_factory.rb', line 113

def build_path_factory
  PathFactory.new(@directory, @prefix, @include_host, @date_pattern, @include_part, @include_uuid, @is_gzipped)
end