Class: RBI::Type::TypeParameter

Inherits:
Type
  • Object
show all
Defined in:
lib/rbi/type.rb

Overview

A type parameter like T.type_parameter(:U).

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

#normalizeObject

: -> Type



611
612
613
# File 'lib/rbi/type.rb', line 611

def normalize
  self
end

#simplifyObject

: -> Type



617
618
619
# File 'lib/rbi/type.rb', line 617

def simplify
  self
end

#to_rbiObject

: -> String



605
606
607
# File 'lib/rbi/type.rb', line 605

def to_rbi
  "::T.type_parameter(#{@name.inspect})"
end