Sha256: c37bbe6fdc181acff15cc5bd801c7784fa8e1c07a91b6dd7bf176ce11263cf48

Contents?: true

Size: 226 Bytes

Versions: 14

Compression:

Stored size: 226 Bytes

Contents

require 'set'

module MongoModel
  module Types
    class Set < Array
      def cast(obj)
        ::Set.new(::Array.wrap(obj))
      end
    end
  end
end

MongoModel::Types.register_converter(Set, MongoModel::Types::Set.new)

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mongomodel-0.5.7 lib/mongomodel/support/types/set.rb
mongomodel-0.5.6 lib/mongomodel/support/types/set.rb
mongomodel-0.5.5 lib/mongomodel/support/types/set.rb
mongomodel-0.5.4 lib/mongomodel/support/types/set.rb
mongomodel-0.5.3 lib/mongomodel/support/types/set.rb
mongomodel-0.5.2 lib/mongomodel/support/types/set.rb
mongomodel-0.5.1 lib/mongomodel/support/types/set.rb
mongomodel-0.5.0 lib/mongomodel/support/types/set.rb
mongomodel-0.4.9 lib/mongomodel/support/types/set.rb
mongomodel-0.4.8 lib/mongomodel/support/types/set.rb
mongomodel-0.4.7 lib/mongomodel/support/types/set.rb
mongomodel-0.4.6 lib/mongomodel/support/types/set.rb
mongomodel-0.4.5 lib/mongomodel/support/types/set.rb
mongomodel-0.4.4 lib/mongomodel/support/types/set.rb