Sha256: 4a9e5277ea4a334232d29893c530da30d85aed4761b0fc8864ac738ea4ef8362
Contents?: true
Size: 468 Bytes
Versions: 6
Compression:
Stored size: 468 Bytes
Contents
# frozen_string_literal: true require 'set' using SmartCore::Ext::BasicObjectAsObject # @api public # @since 0.3.0 SmartCore::Types::Value.define_type(:Set) do |type| type.define_checker do |value| value.is_a?(::Set) end type.define_caster do |value| begin ::Set.new(SmartCore::Types::Value::Array.cast(value)) rescue ::ArgumentError, ::NoMethodError raise(SmartCore::Types::TypeCastingError, 'Non-castable to Set') end end end
Version data entries
6 entries across 6 versions & 1 rubygems