Class: Snmp2mkr::ConfigTypes::TemplatesList
- Defined in:
- lib/snmp2mkr/config_types/templates_list.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(ary) ⇒ 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.
19 20 21 |
# File 'lib/snmp2mkr/config_types/templates_list.rb', line 19 def value @value end |
Instance Method Details
#collect_children ⇒ Object
15 16 17 |
# File 'lib/snmp2mkr/config_types/templates_list.rb', line 15 def collect_children @value end |
#evaluate(context: binded_context, previous: nil) ⇒ Object
21 22 23 |
# File 'lib/snmp2mkr/config_types/templates_list.rb', line 21 def evaluate(context: binded_context, previous: nil) @value.map { |_| _.evaluate(context: context, previous: previous) } end |
#setup(ary) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/snmp2mkr/config_types/templates_list.rb', line 7 def setup(ary) if !ary.kind_of?(Array) || ary.any? { |_| !_.kind_of?(String) } raise TypeError, "#{self.class} must be given an Array<String>" end @value = ary.map { |_| TemplateString.new(_) } end |