Class: MongoidIceCubeExtension::Schedule

Inherits:
Object
  • Object
show all
Defined in:
lib/mongoid_ice_cube_extension/schedule.rb

Class Method Summary collapse

Class Method Details

.demongoize(value) ⇒ Object


6
7
8
9
# File 'lib/mongoid_ice_cube_extension/schedule.rb', line 6

def demongoize(value)
  return unless value
  IceCube::Schedule.from_hash(value)
end

.evolve(value) ⇒ Object


18
19
20
21
22
23
# File 'lib/mongoid_ice_cube_extension/schedule.rb', line 18

def evolve(value)
  case value
  when IceCube::Schedule then value.to_hash
  else value
  end
end

.mongoize(value) ⇒ Object


11
12
13
14
15
16
# File 'lib/mongoid_ice_cube_extension/schedule.rb', line 11

def mongoize(value)
  case value
  when IceCube::Schedule then value.to_hash
  else value
  end
end