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, t_module, #to_s, tuple, type_alias, type_parameter, untyped, void
Constructor Details
#initialize(name) ⇒ TypeParameter
: (Symbol name) -> void
592 593 594 595 |
# File 'lib/rbi/type.rb', line 592 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
: Symbol
589 590 591 |
# File 'lib/rbi/type.rb', line 589 def name @name end |
Instance Method Details
#==(other) ⇒ Object
: (BasicObject other) -> bool
599 600 601 |
# File 'lib/rbi/type.rb', line 599 def ==(other) TypeParameter === other && @name == other.name end |
#normalize ⇒ Object
: -> Type
611 612 613 |
# File 'lib/rbi/type.rb', line 611 def normalize self end |
#simplify ⇒ Object
: -> Type
617 618 619 |
# File 'lib/rbi/type.rb', line 617 def simplify self end |
#to_rbi ⇒ Object
: -> String
605 606 607 |
# File 'lib/rbi/type.rb', line 605 def to_rbi "::T.type_parameter(#{@name.inspect})" end |