class Snmp2mkr::ConfigTypes::MetricDefinitionCollection

Attributes

value[R]

Public Instance Methods

[](k) click to toggle source
# File lib/snmp2mkr/config_types/metric_definition_collection.rb, line 15
def [](k)
  @value[k]
end
collect_children() click to toggle source
# File lib/snmp2mkr/config_types/metric_definition_collection.rb, line 19
def collect_children
  @value.values
end
setup(hash) click to toggle source
# File lib/snmp2mkr/config_types/metric_definition_collection.rb, line 7
def setup(hash)
  if !hash.kind_of?(Hash) || hash.any? { |k,v| !k.kind_of?(String) }
    raise TypeError, "#{self.class} must be given a Hash<String, Object)>"
  end

  @value = hash.map { |k, v| [k, MetricDefinition.new([k,v])] }.to_h
end