Class: Object

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_mongo(value) ⇒ Object



125
126
127
# File 'lib/novelys_mongo_mapper/support.rb', line 125

def self.from_mongo(value)
  value
end

.to_mongo(value) ⇒ Object



121
122
123
# File 'lib/novelys_mongo_mapper/support.rb', line 121

def self.to_mongo(value)
  value
end

Instance Method Details

#class_def(name, &blk) ⇒ Object

Defines an instance method within a class



117
118
119
# File 'lib/novelys_mongo_mapper/support.rb', line 117

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

#meta_def(name, &blk) ⇒ Object

Adds methods to a metaclass



112
113
114
# File 'lib/novelys_mongo_mapper/support.rb', line 112

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

#meta_eval(&blk) ⇒ Object



107
108
109
# File 'lib/novelys_mongo_mapper/support.rb', line 107

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

#metaclassObject

The hidden singleton lurks behind everyone



103
104
105
# File 'lib/novelys_mongo_mapper/support.rb', line 103

def metaclass
  class << self; self end
end