class Hash

Public Instance Methods

apply_to(object) click to toggle source

Public: Iterates through the keys of this hash and for each key sets the attribute of the same name on ‘object`. If a property of the same does not exist, it is silently ignored.

object - The object on which to apply the values of this Hash.

# File lib/confer/extensions/hash.rb, line 11
def apply_to(object)
  self.each { |k, v| object.send("#{k}=", v) if object.respond_to? "#{k}=" }
end