Class: LogStash::Config::File
- Inherits:
-
Object
- Object
- LogStash::Config::File
- Includes:
- Enumerable, Util::Loggable
- Defined in:
- lib/logstash/config/file.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(text) ⇒ File
constructor
A new instance of File.
-
#parse(text) ⇒ Object
def initialize.
-
#plugin(plugin_type, name, *args) ⇒ Object
def parse.
Constructor Details
#initialize(text) ⇒ File
Returns a new instance of File.
11 12 13 14 |
# File 'lib/logstash/config/file.rb', line 11 def initialize(text) @text = text @config = parse(text) end |
Instance Method Details
#each ⇒ Object
30 31 32 |
# File 'lib/logstash/config/file.rb', line 30 def each @config.recursive_select(LogStash::Config::AST::Plugin) end |
#parse(text) ⇒ Object
def initialize
16 17 18 19 20 21 22 23 |
# File 'lib/logstash/config/file.rb', line 16 def parse(text) grammar = LogStashConfigParser.new result = grammar.parse(text) if result.nil? raise LogStash::ConfigurationError, grammar.failure_reason end return result end |