module RBS::Types::_TypeBase
_TypeBase interface represents the operations common to all of the types.
Public Instance Methods
() { (t) → void } → void
() → Enumerator[t, void]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/types.rbs, line 27
def each_type: () { (t) -> void } -> void
| () -> Enumerator[t, void]
Yields all direct sub types included in the type. It doesnβt yield the type itself.
parse("Hash[String, Array[Symbol]]").each_type do |ty| ... # Yields String and Array[Symbol] end
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/types.rbs, line 9
def free_variables: (?Set[Symbol]) -> Set[Symbol]
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/types.rbs, line 50
def has_classish_type?: () -> bool
Returns true if it has instance or class types
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/types.rbs, line 47
def has_self_type?: () -> bool
Returns true if it has self type
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/types.rbs, line 16
def map_type_name: () { (TypeName, Location[untyped, untyped]?, t) -> TypeName } -> t
Maps type names included in the type and returns new instance of type.
(Substitution) → t
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/types.rbs, line 13
def sub: (Substitution) -> t
Receives a substitution and returns a new type applied the substitution.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/types.rbs, line 43
def to_s: (?Integer level) -> String
Returns a String representation. level is used internally.
parse("String").to_s # => "String" parse("String | Integer").to_s() # => "String | Integer" parse("String | Integer").to_s(1) # => "(String | Integer)"
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/types.rbs, line 57
def with_nonreturn_void?: () -> bool
Returns true if it has void types other than return position
-
The function return type is a return position (
() -> void) -
Generic parameter is a return position (
Enumerator[Integer, void])