Module: Oxidized::Config::Vars

Included in:
Input, Model
Defined in:
lib/oxidized/config/vars.rb

Instance Method Summary collapse

Instance Method Details

#vars(name) ⇒ Object

convenience method for accessing node, group or global level user variables nil values will be ignored



4
5
6
7
8
9
# File 'lib/oxidized/config/vars.rb', line 4

def vars name
  r =   @node.vars[name] unless @node.vars.nil?
  r ||= Oxidized::CFG.groups[@node.group].vars[name.to_s] if Oxidized::CFG.groups.has_key?(@node.group)
  r ||= Oxidized::CFG.vars[name.to_s] if Oxidized::CFG.vars.has_key?(name.to_s)
  r
end