Class: Snmp2mkr::ConfigTypes::EnvString
- Defined in:
- lib/snmp2mkr/config_types/env_string.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#bind_context, #children, #collect_children, #evaluate, #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.
17 18 19 |
# File 'lib/snmp2mkr/config_types/env_string.rb', line 17 def value @value end |
Instance Method Details
#setup(str_or_hash) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/snmp2mkr/config_types/env_string.rb', line 6 def setup(str_or_hash) @value = case str_or_hash when String str_or_hash when Hash ENV.fetch(str_or_hash.fetch('env')) else raise TypeError, "#{self.class} must be given a String or a Hash with key 'env'" end end |