Sha256: 8d24b9b5c8c71d5af71524768f91582db6e4b8925e61fa3d5c6880d709f85228

Contents?: true

Size: 485 Bytes

Versions: 5

Compression:

Stored size: 485 Bytes

Contents

require 'ice_cube'

module MongoidIceCubeExtension
  class Schedule
    class << self
      def demongoize(value)
        return unless value
        IceCube::Schedule.from_hash(value)
      end

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mongoid_ice_cube_extension-0.2.4 lib/mongoid_ice_cube_extension/schedule.rb
mongoid_ice_cube_extension-0.2.3 lib/mongoid_ice_cube_extension/schedule.rb
mongoid_ice_cube_extension-0.2.2 lib/mongoid_ice_cube_extension/schedule.rb
mongoid_ice_cube_extension-0.2.1 lib/mongoid_ice_cube_extension/schedule.rb
mongoid_ice_cube_extension-0.2.0 lib/mongoid_ice_cube_extension/schedule.rb