Class: Fluent::Config::YamlParser::RootBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/config/yaml_parser/section_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(system, conf) ⇒ RootBuilder

Returns a new instance of RootBuilder.



41
42
43
44
# File 'lib/fluent/config/yaml_parser/section_builder.rb', line 41

def initialize(system, conf)
  @system = system
  @conf = conf
end

Instance Attribute Details

#confObject (readonly)

Returns the value of attribute conf.



46
47
48
# File 'lib/fluent/config/yaml_parser/section_builder.rb', line 46

def conf
  @conf
end

#systemObject (readonly)

Returns the value of attribute system.



46
47
48
# File 'lib/fluent/config/yaml_parser/section_builder.rb', line 46

def system
  @system
end

Instance Method Details

#to_elementObject



48
49
50
# File 'lib/fluent/config/yaml_parser/section_builder.rb', line 48

def to_element
  Fluent::Config::Element.new('ROOT', '', {}, [@system, @conf].compact.map(&:to_element).flatten)
end

#to_sObject



52
53
54
55
56
57
58
# File 'lib/fluent/config/yaml_parser/section_builder.rb', line 52

def to_s
  s = StringIO.new(+'')
  s.puts(@system.to_s) if @system
  s.puts(@conf.to_s) if @conf

  s.string
end