Module: CodyRobbins::EasierInstanceVariableAccess
- Defined in:
- lib/cody_robbins/easier_instance_variable_access.rb
Instance Method Summary collapse
-
#instance_variable(name) ⇒ Object
(also: #get_instance_variable)
Returns the value of the specified instance variable, just like
Object#instance_variable_get
. -
#set_instance_variable(name, value) ⇒ Object
Sets the value of the specified instance variable, just like
Object#instance_variable_set
.
Instance Method Details
#instance_variable(name) ⇒ Object Also known as: get_instance_variable
Returns the value of the specified instance variable, just like Object#instance_variable_get
.
9 10 11 |
# File 'lib/cody_robbins/easier_instance_variable_access.rb', line 9 def instance_variable(name) instance_variable_get(instance_variable_name(name)) end |
#set_instance_variable(name, value) ⇒ Object
Sets the value of the specified instance variable, just like Object#instance_variable_set
.
18 19 20 |
# File 'lib/cody_robbins/easier_instance_variable_access.rb', line 18 def set_instance_variable(name, value) instance_variable_set(instance_variable_name(name), value) end |