Class: LogStash::Config::AST::Elsif

Inherits:
BranchEntry
  • Object
show all
Defined in:
lib/logstash/config/config_ast.rb

Instance Method Summary collapse

Methods inherited from Node

#text_value_for_comments

Instance Method Details

#compileObject



442
443
444
445
446
# File 'lib/logstash/config/config_ast.rb', line 442

def compile
  children = recursive_inject { |e| e.is_a?(Branch) || e.is_a?(Plugin) }
  return "elsif #{condition.compile} # else if #{condition.text_value_for_comments}\n" \
    << children.collect(&:compile).map { |s| s.split("\n", -1).map { |l| "  " + l }.join("\n") }.join("") << "\n"
end