Class: Fluent::Config::YamlParser::RootBuilder
- Inherits:
-
Object
- Object
- Fluent::Config::YamlParser::RootBuilder
- Defined in:
- lib/fluent/config/yaml_parser/section_builder.rb
Instance Attribute Summary collapse
-
#conf ⇒ Object
readonly
Returns the value of attribute conf.
-
#system ⇒ Object
readonly
Returns the value of attribute system.
Instance Method Summary collapse
-
#initialize(system, conf) ⇒ RootBuilder
constructor
A new instance of RootBuilder.
- #to_element ⇒ Object
- #to_s ⇒ Object
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
#conf ⇒ Object (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 |
#system ⇒ Object (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_element ⇒ Object
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_s ⇒ Object
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 |