obj.remove_instance_variable(symbol) â obj
Instance Public methods
Removes the named instance variable from obj, returning that variable's value.
class Dummy attr_reader :var def initialize @var = 99 end def remove remove_instance_variable(:@var) end end d = Dummy.new d.var #=> 99 d.remove #=> 99 d.var #=> nil
Please login to continue.