Parent

Class/Module Index [+]

Quicksearch

Fluent::Config::Element

Attributes

arg[RW]
elements[RW]
name[RW]
used[RW]

Public Class Methods

new(name, arg, attrs, elements, used=[]) click to toggle source
# File lib/fluent/config.rb, line 30
def initialize(name, arg, attrs, elements, used=[])
  @name = name
  @arg = arg
  @elements = elements
  super()
  attrs.each {|k,v|
    self[k] = v
  }
  @used = used
end

Public Instance Methods

+(o) click to toggle source
# File lib/fluent/config.rb, line 49
def +(o)
  Element.new(@name.dup, @arg.dup, o.merge(self), @elements+o.elements, @used+o.used)
end
[](key) click to toggle source
# File lib/fluent/config.rb, line 58
def [](key)
  @used << key
  super
end
add_element(name, arg='') click to toggle source
# File lib/fluent/config.rb, line 43
def add_element(name, arg='')
  e = Element.new(name, arg, {}, [])
  @elements << e
  e
end
check_not_fetched(&block) click to toggle source
# File lib/fluent/config.rb, line 63
def check_not_fetched(&block)
  each_key {|key|
    unless @used.include?(key)
      block.call(key, self)
    end
  }
  @elements.each {|e|
    e.check_not_fetched(&block)
  }
end
has_key?(key) click to toggle source
# File lib/fluent/config.rb, line 53
def has_key?(key)
  @used << key
  super
end
to_s(nest = 0) click to toggle source
# File lib/fluent/config.rb, line 74
def to_s(nest = 0)
  indent = "  "*nest
  nindent = "  "*(nest+1)
  out = ""
  if @arg.empty?
    out << "#{indent}<#{@name}>\n"
  else
    out << "#{indent}<#{@name} #{@arg}>\n"
  end
  each_pair {|k,v|
    out << "#{nindent}#{k} #{v}\n"
  }
  @elements.each {|e|
    out << e.to_s(nest+1)
  }
  out << "#{indent}</#{@name}>\n"
  out
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.