Class: Snmp2mkr::ConfigTypes::Template
- Defined in:
- lib/snmp2mkr/config_types/template.rb
Instance Attribute Summary collapse
-
#interfaces ⇒ Object
readonly
Returns the value of attribute interfaces.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#metric_discoveries ⇒ Object
readonly
Returns the value of attribute metric_discoveries.
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
-
#vhost_discoveries ⇒ Object
readonly
Returns the value of attribute vhost_discoveries.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#bind_context, #children, #evaluate, #initialize, #inspect
Constructor Details
This class inherits a constructor from Snmp2mkr::ConfigTypes::Base
Instance Attribute Details
#interfaces ⇒ Object (readonly)
Returns the value of attribute interfaces.
38 39 40 |
# File 'lib/snmp2mkr/config_types/template.rb', line 38 def interfaces @interfaces end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
38 39 40 |
# File 'lib/snmp2mkr/config_types/template.rb', line 38 def @meta end |
#metric_discoveries ⇒ Object (readonly)
Returns the value of attribute metric_discoveries.
38 39 40 |
# File 'lib/snmp2mkr/config_types/template.rb', line 38 def metric_discoveries @metric_discoveries end |
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
38 39 40 |
# File 'lib/snmp2mkr/config_types/template.rb', line 38 def metrics @metrics end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
38 39 40 |
# File 'lib/snmp2mkr/config_types/template.rb', line 38 def name @name end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
38 39 40 |
# File 'lib/snmp2mkr/config_types/template.rb', line 38 def templates @templates end |
#vhost_discoveries ⇒ Object (readonly)
Returns the value of attribute vhost_discoveries.
38 39 40 |
# File 'lib/snmp2mkr/config_types/template.rb', line 38 def vhost_discoveries @vhost_discoveries end |
Instance Method Details
#collect_children ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/snmp2mkr/config_types/template.rb', line 27 def collect_children [ @templates, @metrics, @meta, @interfaces, @metric_discoveries, @vhost_discoveries, ].compact end |
#setup(kv) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/snmp2mkr/config_types/template.rb', line 13 def setup(kv) raise TypeError, "#{self.class} must be given an Array (BUG?)" unless kv.kind_of?(Array) && kv.size == 2 k, hash = kv @name = k raise TypeError, "#{self.class} must be given a Hash" unless hash.kind_of?(Hash) @templates = hash.key?('templates') ? TemplatesList.new(hash['templates']) : nil @metrics = hash.key?('metrics') ? MetricDefinitionCollection.new(hash['metrics']) : nil @meta = hash.key?('meta') ? MetaDefinition.new(hash['meta']) : nil @interfaces = hash.key?('interfaces') ? InterfacesDefinition.new(hash['interfaces']) : nil @metric_discoveries = hash.key?('metric_discoveries') ? MetricDiscoveryRuleCollection.new(hash['metric_discoveries']) : nil @vhost_discoveries = hash.key?('vhost_discoveries') ? VhostDiscoveryRuleCollection.new(hash['vhost_discoveries']) : nil end |