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
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/fluent/config/dsl.rb', line 62 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
43 44 45 |
# File 'lib/fluent/config/dsl.rb', line 43 def element @element end |
#eval(source, source_path) ⇒ Object
51 52 53 54 |
# File 'lib/fluent/config/dsl.rb', line 51 def eval(source, source_path) @element.instance_eval(source, source_path) self end |
#include_basepath ⇒ Object
47 48 49 |
# File 'lib/fluent/config/dsl.rb', line 47 def include_basepath @include_basepath end |