Module: Mongoid::Extensions::Object

Defined in:
lib/locomotive/mongoid/patches.rb

Instance Method Summary collapse

Instance Method Details

#ivar(name) ⇒ Object


98
99
100
101
102
103
104
# File 'lib/locomotive/mongoid/patches.rb', line 98

def ivar(name)
  if instance_variable_defined?("@_#{name}_ivar")
    return instance_variable_get("@_#{name}_ivar")
  else
    false
  end
end

#remove_ivar(name) ⇒ Object


105
106
107
108
109
110
111
# File 'lib/locomotive/mongoid/patches.rb', line 105

def remove_ivar(name)
  if instance_variable_defined?("@_#{name}_ivar")
    return remove_instance_variable("@_#{name}_ivar")
  else
    false
  end
end