Class: T::Types::TypeParameter
- Inherits:
-
Base
- Object
- Base
- T::Types::TypeParameter
show all
- Defined in:
- lib/types/types/type_parameter.rb
Instance Method Summary
collapse
Methods inherited from Base
#==, #describe_obj, #error_message_for_obj, #hash, method_added, #subtype_of?, #to_s, #validate!
Constructor Details
Returns a new instance of TypeParameter.
6
7
8
9
|
# File 'lib/types/types/type_parameter.rb', line 6
def initialize(name)
raise ArgumentError.new("not a symbol: #{name}") unless name.is_a?(Symbol)
@name = name
end
|
Instance Method Details
#name ⇒ Object
19
20
21
|
# File 'lib/types/types/type_parameter.rb', line 19
def name
"T.type_parameter(#{@name})"
end
|
#subtype_of_single?(type) ⇒ Boolean
15
16
17
|
# File 'lib/types/types/type_parameter.rb', line 15
def subtype_of_single?(type)
true
end
|
#valid?(obj) ⇒ Boolean
11
12
13
|
# File 'lib/types/types/type_parameter.rb', line 11
def valid?(obj)
true
end
|