Class: Fluent::Config::DSL::Proxy
- Inherits:
-
Object
- Object
- Fluent::Config::DSL::Proxy
- Defined in:
- lib/fluent/config/dsl.rb
Instance Method Summary collapse
- #add_element(name, arg, block) ⇒ Object
- #element ⇒ Object
- #eval(source, source_path) ⇒ Object
- #include_basepath ⇒ Object
-
#initialize(name, arg, include_basepath = Dir.pwd) ⇒ Proxy
constructor
A new instance of Proxy.
- #to_config_element ⇒ Object
Constructor Details
Instance Method Details
#add_element(name, arg, block) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/fluent/config/dsl.rb', line 64 def add_element(name, arg, block) ::Kernel.raise ::ArgumentError, "#{name} block must be specified" if block.nil? proxy = self.class.new(name.to_s, arg) proxy.element.instance_exec(&block) @element.instance_eval do @elements.push(proxy.to_config_element) end self end |
#element ⇒ Object
45 46 47 |
# File 'lib/fluent/config/dsl.rb', line 45 def element @element end |
#eval(source, source_path) ⇒ Object
53 54 55 56 |
# File 'lib/fluent/config/dsl.rb', line 53 def eval(source, source_path) @element.instance_eval(source, source_path) self end |
#include_basepath ⇒ Object
49 50 51 |
# File 'lib/fluent/config/dsl.rb', line 49 def include_basepath @include_basepath end |