Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/mongomapper/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
117 118 119 |
# File 'lib/mongomapper/support.rb', line 117 def self.from_mongo(value) value end |
.to_mongo(value) ⇒ Object
113 114 115 |
# File 'lib/mongomapper/support.rb', line 113 def self.to_mongo(value) value end |
Instance Method Details
#class_def(name, &blk) ⇒ Object
Defines an instance method within a class
109 110 111 |
# File 'lib/mongomapper/support.rb', line 109 def class_def(name, &blk) class_eval { define_method(name, &blk) } end |
#meta_def(name, &blk) ⇒ Object
Adds methods to a metaclass
104 105 106 |
# File 'lib/mongomapper/support.rb', line 104 def (name, &blk) { define_method(name, &blk) } end |
#meta_eval(&blk) ⇒ Object
99 100 101 |
# File 'lib/mongomapper/support.rb', line 99 def (&blk) .instance_eval(&blk) end |
#metaclass ⇒ Object
The hidden singleton lurks behind everyone
95 96 97 |
# File 'lib/mongomapper/support.rb', line 95 def class << self; self end end |