Method: Puppet::Pops::Adaptable::Adapter.clear

Defined in:
lib/puppet/pops/adaptable.rb

.clear(o) ⇒ Adapter?

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.

Clears the adapter set in the given object o. Returns any set adapter or nil.

Parameters:

  • o (Adaptable)

    the object where the adapter should be cleared

Returns:

  • (Adapter)

    if an adapter was set

  • (nil)

    if the adapter has not been set



141
142
143
144
145
146
147
148
# File 'lib/puppet/pops/adaptable.rb', line 141

def self.clear(o)
  attr_name = self_attr_name
  if o.instance_variable_defined?(attr_name)
    o.send(:remove_instance_variable, attr_name)
  else
    nil
  end
end