Class: GlobalID

Inherits:
Object
  • Object
show all
Defined in:
lib/workarea/ext/freedom_patches/global_id.rb

Class Method Summary collapse

Class Method Details

.demongoize(object) ⇒ Object



3
4
5
# File 'lib/workarea/ext/freedom_patches/global_id.rb', line 3

def demongoize(object)
  GlobalID.new(object)
end

.evolve(object) ⇒ Object



15
16
17
18
19
20
# File 'lib/workarea/ext/freedom_patches/global_id.rb', line 15

def evolve(object)
  case object
  when GlobalID then object.mongoize
  else object
  end
end

.mongoize(object) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/workarea/ext/freedom_patches/global_id.rb', line 7

def mongoize(object)
  case object
  when GlobalID then object.mongoize
  when String then GlobalID.new(object).mongoize
  else object
  end
end