Class: RBI::Type::TypeParameter
Overview
A type parameter like ‘T.type_parameter(:U)`.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
: Symbol.
Instance Method Summary collapse
-
#==(other) ⇒ Object
: (BasicObject other) -> bool.
-
#initialize(name) ⇒ TypeParameter
constructor
: (Symbol name) -> void.
-
#normalize ⇒ Object
: -> Type.
-
#simplify ⇒ Object
: -> Type.
-
#to_rbi ⇒ Object
: -> String.
Methods inherited from RBI::Type
all, any, anything, attached_class, boolean, class_of, #eql?, generic, #hash, #nilable, nilable, #nilable?, #non_nilable, noreturn, parse_node, parse_string, proc, #rbs_string, self_type, shape, simple, t_class, #to_s, tuple, type_parameter, untyped, void
Constructor Details
#initialize(name) ⇒ TypeParameter
: (Symbol name) -> void
556 557 558 559 |
# File 'lib/rbi/type.rb', line 556 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
: Symbol
553 554 555 |
# File 'lib/rbi/type.rb', line 553 def name @name end |
Instance Method Details
#==(other) ⇒ Object
: (BasicObject other) -> bool
563 564 565 |
# File 'lib/rbi/type.rb', line 563 def ==(other) TypeParameter === other && @name == other.name end |
#normalize ⇒ Object
: -> Type
575 576 577 |
# File 'lib/rbi/type.rb', line 575 def normalize self end |
#simplify ⇒ Object
: -> Type
581 582 583 |
# File 'lib/rbi/type.rb', line 581 def simplify self end |
#to_rbi ⇒ Object
: -> String
569 570 571 |
# File 'lib/rbi/type.rb', line 569 def to_rbi "T.type_parameter(#{@name.inspect})" end |