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.
Methods included from Util::Loggable
included, #logger, #slow_logger
Constructor Details
#initialize(text) ⇒ File
Returns a new instance of File.
13 14 15 16 |
# File 'lib/logstash/config/file.rb', line 13 def initialize(text) @text = text @config = parse(text) end |
Instance Method Details
#each ⇒ Object
32 33 34 |
# File 'lib/logstash/config/file.rb', line 32 def each @config.recursive_select(LogStash::Config::AST::Plugin) end |
#parse(text) ⇒ Object
def initialize
18 19 20 21 22 23 24 25 |
# File 'lib/logstash/config/file.rb', line 18 def parse(text) grammar = LogStashConfigParser.new result = grammar.parse(text) if result.nil? raise LogStash::ConfigurationError, grammar.failure_reason end return result end |