Class: Parlour::Types::Type
- Inherits:
-
Object
- Object
- Parlour::Types::Type
show all
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/parlour/types.rb
Overview
The top-level, abstract class for a generalised type. All of the other types inherit from this. Do not instantiate.
Direct Known Subclasses
Boolean, Class, Generic, Hash, Intersection, Nilable, Proc, Raw, Record, Self, SingleElementCollection, Tuple, Union, Untyped
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.to_type(type_like) ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/parlour/types.rb', line 23
def self.to_type(type_like)
if type_like.is_a?(String)
Raw.new(type_like)
else
type_like
end
end
|
Instance Method Details
#describe ⇒ Object
41
|
# File 'lib/parlour/types.rb', line 41
def describe; end
|
#generate_rbi ⇒ Object
17
|
# File 'lib/parlour/types.rb', line 17
def generate_rbi; end
|
#generate_rbs ⇒ Object
20
|
# File 'lib/parlour/types.rb', line 20
def generate_rbs; end
|
#hash ⇒ Object
36
37
38
|
# File 'lib/parlour/types.rb', line 36
def hash
[self.class, *instance_variables.map { |x| instance_variable_get(x).hash }].hash
end
|
#to_type(type_like) ⇒ Object
32
33
34
|
# File 'lib/parlour/types.rb', line 32
def to_type(type_like)
Type.to_type(type_like)
end
|