Method: Puppet::Property.value_option

Defined in:
lib/puppet/property.rb

.value_option(name, option) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

TODO:

Guessing on result of passing a non supported option (it performs send(option)).

Returns the value of the given option (set when a valid value with the given “name” was defined).

Parameters:

  • name (Symbol, Regexp)

    the valid value predicate as returned by value_name

  • option (Symbol)

    the name of the wanted option

Returns:

  • (Object)

    value of the option

Raises:

  • (NoMethodError)

    if the option is not supported



138
139
140
141
142
# File 'lib/puppet/property.rb', line 138

def self.value_option(name, option)
  if value = value_collection.value(name)
    value.send(option)
  end
end