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.
-
#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
310 311 312 313 |
# File 'lib/rbi/type.rb', line 310 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
: Symbol
307 308 309 |
# File 'lib/rbi/type.rb', line 307 def name @name end |
Instance Method Details
#==(other) ⇒ Object
: (BasicObject other) -> bool
317 318 319 |
# File 'lib/rbi/type.rb', line 317 def ==(other) TypeParameter === other && @name == other.name end |
#to_rbi ⇒ Object
: -> String
323 324 325 |
# File 'lib/rbi/type.rb', line 323 def to_rbi "T.type_parameter(#{@name.inspect})" end |