Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/git/lighttp/extensions.rb
Instance Method Summary collapse
-
#instance_variables_set_from(hash) ⇒ Object
Set instance variables by key and value only if object respond to access method for variable.
Instance Method Details
#instance_variables_set_from(hash) ⇒ Object
Set instance variables by key and value only if object respond to access method for variable.
4 5 6 7 8 9 |
# File 'lib/git/lighttp/extensions.rb', line 4 def instance_variables_set_from(hash) hash.collect do |variable, value| self.instance_variable_set("@#{variable}", value) if self.respond_to? variable end self end |