Class: T::Types::TypedSet::Untyped
- Inherits:
-
T::Types::TypedSet
- Object
- Base
- T::Types::TypedEnumerable
- T::Types::TypedSet
- T::Types::TypedSet::Untyped
- Defined in:
- lib/types/types/typed_set.rb
Instance Method Summary collapse
-
#initialize ⇒ Untyped
constructor
A new instance of Untyped.
- #valid?(obj) ⇒ Boolean
Methods inherited from T::Types::TypedSet
#name, #new, #recursively_valid?, #underlying_class
Methods inherited from T::Types::TypedEnumerable
#build_type, #describe_obj, #name, #recursively_valid?, #type, #underlying_class
Methods inherited from Base
#==, #describe_obj, #error_message_for_obj, #error_message_for_obj_recursive, #hash, method_added, #recursively_valid?, #subtype_of?, #to_s, #validate!
Constructor Details
Instance Method Details
#valid?(obj) ⇒ Boolean
43 44 45 46 47 48 |
# File 'lib/types/types/typed_set.rb', line 43 def valid?(obj) # Re-implements non_forcing_is_a? return false if Object.autoload?(:Set) # Set is meant to be autoloaded but not yet loaded, this value can't be a Set return false unless Object.const_defined?(:Set) # Set is not loaded yet obj.is_a?(Set) end |