Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/mongo_mapper/support.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#class_def(name, &blk) ⇒ Object
Defines an instance method within a class.
-
#meta_def(name, &blk) ⇒ Object
Adds methods to a metaclass.
- #meta_eval(&blk) ⇒ Object
-
#metaclass ⇒ Object
The hidden singleton lurks behind everyone.
Class Method Details
.from_mongo(value) ⇒ Object
118 119 120 |
# File 'lib/mongo_mapper/support.rb', line 118 def self.from_mongo(value) value end |
.to_mongo(value) ⇒ Object
114 115 116 |
# File 'lib/mongo_mapper/support.rb', line 114 def self.to_mongo(value) value end |
Instance Method Details
#class_def(name, &blk) ⇒ Object
Defines an instance method within a class
110 111 112 |
# File 'lib/mongo_mapper/support.rb', line 110 def class_def(name, &blk) class_eval { define_method(name, &blk) } end |
#meta_def(name, &blk) ⇒ Object
Adds methods to a metaclass
105 106 107 |
# File 'lib/mongo_mapper/support.rb', line 105 def (name, &blk) { define_method(name, &blk) } end |
#meta_eval(&blk) ⇒ Object
100 101 102 |
# File 'lib/mongo_mapper/support.rb', line 100 def (&blk) .instance_eval(&blk) end |
#metaclass ⇒ Object
The hidden singleton lurks behind everyone
96 97 98 |
# File 'lib/mongo_mapper/support.rb', line 96 def class << self; self end end |