Module: Mongoid::Extensions::Object

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

Instance Method Summary collapse

Instance Method Details

#ivar(name) ⇒ Object



76
77
78
79
80
81
82
# File 'lib/locomotive/mongoid/patches.rb', line 76

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

#remove_ivar(name) ⇒ Object



83
84
85
86
87
88
89
# File 'lib/locomotive/mongoid/patches.rb', line 83

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