Class: T::Types::TypeParameter
- Inherits:
-
Base
- Object
- Base
- T::Types::TypeParameter
show all
- Defined in:
- lib/types/types/type_parameter.rb
Defined Under Namespace
Modules: Private
Class Method Summary
collapse
Instance Method Summary
collapse
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
Returns a new instance of TypeParameter.
18
19
20
21
|
# File 'lib/types/types/type_parameter.rb', line 18
def initialize(name)
raise ArgumentError.new("not a symbol: #{name}") unless name.is_a?(Symbol)
@name = name
end
|
Instance Method Details
#name ⇒ Object
38
39
40
|
# File 'lib/types/types/type_parameter.rb', line 38
def name
"T.type_parameter(:#{@name})"
end
|
#subtype_of_single?(type) ⇒ Boolean
34
35
36
|
# File 'lib/types/types/type_parameter.rb', line 34
def subtype_of_single?(type)
true
end
|
#valid?(obj) ⇒ Boolean
30
31
32
|
# File 'lib/types/types/type_parameter.rb', line 30
def valid?(obj)
true
end
|