Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/git/lighttp/extensions.rb
Overview
:nodoc:
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.
5 6 7 8 9 10 |
# File 'lib/git/lighttp/extensions.rb', line 5 def instance_variables_set_from(hash) hash.collect do |variable, value| instance_variable_set("@#{variable}", value) if respond_to? variable end self end |