Sha256: a8c26378092219af4c2c60eb25aeba10c91fc5f77fd95b41cc379ec129638adf
Contents?: true
Size: 976 Bytes
Versions: 5
Compression:
Stored size: 976 Bytes
Contents
module Oxidized::Config::Vars # convenience method for accessing node, group or global level user variables def vars(name) model_name = @node.model.class.name.to_s.downcase if @node.vars&.has_key?(name) @node.vars[name] elsif Oxidized.config.groups.has_key?(@node.group) && Oxidized.config.groups[@node.group].models.has_key(model_name) && Oxidized.config.groups[@node.group].models[model_name].vars.has_key?(name.to_s) Oxidized.config.groups[@node.group].models[model_name].vars[name.to_s] elsif Oxidized.config.groups.has_key?(@node.group) && Oxidized.config.groups[@node.group].vars.has_key?(name.to_s) Oxidized.config.groups[@node.group].vars[name.to_s] elsif Oxidized.config.models.has_key(model_name) && Oxidized.config.models[model_name].vars.has_key?(name.to_s) Oxidized.config.models[model_name].vars[name.to_s] elsif Oxidized.config.vars.has_key?(name.to_s) Oxidized.config.vars[name.to_s] end end end
Version data entries
5 entries across 5 versions & 1 rubygems