From 645c2bbefc96f38bc4d212e4f49e022ab98e6ffb Mon Sep 17 00:00:00 2001 From: uu59 Date: Tue, 25 Nov 2014 17:43:11 +0900 Subject: [PATCH] Refactor: Config#config -> Config#fl_config --- app/models/fluentd/setting/config.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/fluentd/setting/config.rb b/app/models/fluentd/setting/config.rb index 6cc0b2c..ed5ba74 100644 --- a/app/models/fluentd/setting/config.rb +++ b/app/models/fluentd/setting/config.rb @@ -3,26 +3,26 @@ require 'fluent/config' class Fluentd module Setting class Config - attr_reader :config, :file + attr_reader :fl_config, :file + delegate :elements, :to_s, to: :fl_config def initialize(config_file) - config = Fluent::Config.parse(IO.read(config_file), config_file, nil, true) - @config = config + @fl_config = Fluent::Config.parse(IO.read(config_file), config_file, nil, true) @file = config_file end def empty? - config.elements.length.zero? + elements.length.zero? end def sources - config.elements.find_all do |elm| + elements.find_all do |elm| elm.name == "source" end end def matches - config.elements.find_all do |elm| + elements.find_all do |elm| elm.name == "match" end end