Class: Object

Inherits:
BasicObject
Defined in:
lib/mongo_mapper/support.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_mongo(value) ⇒ Object



124
125
126
# File 'lib/mongo_mapper/support.rb', line 124

def self.from_mongo(value)
  value
end

.to_mongo(value) ⇒ Object



120
121
122
# File 'lib/mongo_mapper/support.rb', line 120

def self.to_mongo(value)
  value
end

Instance Method Details

#class_def(name, &blk) ⇒ Object

Defines an instance method within a class



116
117
118
# File 'lib/mongo_mapper/support.rb', line 116

def class_def(name, &blk)
  class_eval { define_method(name, &blk) }
end

#meta_def(name, &blk) ⇒ Object

Adds methods to a metaclass



111
112
113
# File 'lib/mongo_mapper/support.rb', line 111

def meta_def(name, &blk)
  meta_eval { define_method(name, &blk) }
end

#meta_eval(&blk) ⇒ Object



106
107
108
# File 'lib/mongo_mapper/support.rb', line 106

def meta_eval(&blk)
  metaclass.instance_eval(&blk)
end

#metaclassObject

The hidden singleton lurks behind everyone



102
103
104
# File 'lib/mongo_mapper/support.rb', line 102

def metaclass
  class << self; self end
end