Class: T::Types::TypedClass
Defined Under Namespace
Modules: Private Classes: Anything, Untyped
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type) ⇒ TypedClass
constructor
A new instance of TypedClass.
-
#name ⇒ Object
overrides Base.
- #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.
8 9 10 |
# File 'lib/types/types/typed_class.rb', line 8 def initialize(type) @type = T::Utils.coerce(type) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/types/types/typed_class.rb', line 6 def type @type end |
Instance Method Details
#name ⇒ Object
overrides Base
13 14 15 |
# File 'lib/types/types/typed_class.rb', line 13 def name "T::Class[#{@type.name}]" end |
#underlying_class ⇒ Object
17 18 19 |
# File 'lib/types/types/typed_class.rb', line 17 def Class end |