Class: T::Types::TypedClass
Defined Under Namespace
Modules: Private Classes: Anything, Untyped
Instance Method Summary collapse
- #build_type ⇒ Object
-
#initialize(type) ⇒ TypedClass
constructor
A new instance of TypedClass.
-
#name ⇒ Object
overrides Base.
- #type ⇒ Object
- #underlying_class ⇒ Object
-
#valid?(obj) ⇒ Boolean
overrides Base.
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
#initialize(type) ⇒ TypedClass
Returns a new instance of TypedClass.
6 7 8 |
# File 'lib/types/types/typed_class.rb', line 6 def initialize(type) @inner_type = type end |
Instance Method Details
#build_type ⇒ Object
14 15 16 17 |
# File 'lib/types/types/typed_class.rb', line 14 def build_type type nil end |
#name ⇒ Object
overrides Base
20 21 22 |
# File 'lib/types/types/typed_class.rb', line 20 def name "T::Class[#{type.name}]" end |
#type ⇒ Object
10 11 12 |
# File 'lib/types/types/typed_class.rb', line 10 def type @type ||= T::Utils.coerce(@inner_type) end |
#underlying_class ⇒ Object
24 25 26 |
# File 'lib/types/types/typed_class.rb', line 24 def Class end |