Method: Tap::Controller.set
- Defined in:
- lib/tap/controller.rb
.set(variable, value) ⇒ Object
Sets an instance variable for self (ie the class), short for:
instance_variable_set(:@attribute, value)
Set variables inherited by subclasses. The value is duplicated on the subclass so the parent and child variable may be modified independently.
57 58 59 60 |
# File 'lib/tap/controller.rb', line 57 def set(variable, value) set_variables << variable instance_variable_set("@#{variable}", value) end |