Class: Snmp2mkr::ConfigTypes::Oid
- Defined in:
- lib/snmp2mkr/config_types/oid.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Base
Instance Method Summary collapse
- #collect_children ⇒ Object
- #evaluate(context: binded_context, previous: nil) ⇒ Object
- #setup(str) ⇒ Object
Methods inherited from Base
#bind_context, #children, #initialize, #inspect
Constructor Details
This class inherits a constructor from Snmp2mkr::ConfigTypes::Base
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13 14 15 |
# File 'lib/snmp2mkr/config_types/oid.rb', line 13 def value @value end |
Instance Method Details
#collect_children ⇒ Object
15 16 17 |
# File 'lib/snmp2mkr/config_types/oid.rb', line 15 def collect_children [@value] end |
#evaluate(context: binded_context, previous: nil) ⇒ Object
19 20 21 |
# File 'lib/snmp2mkr/config_types/oid.rb', line 19 def evaluate(context: binded_context, previous: nil) value.evaluate(context: context, previous: previous) end |
#setup(str) ⇒ Object
8 9 10 11 |
# File 'lib/snmp2mkr/config_types/oid.rb', line 8 def setup(str) raise TypeError, 'Oid must be given a String or a TemplateString' unless str.kind_of?(String) || str.kind_of?(TemplateString) @value = str.is_a?(String) ? RawString.new(str) : str end |