Class: RBI::Type::Class

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

Overview

The class of another type like ‘T::Class`.

Instance Attribute Summary collapse

Instance Method Summary collapse

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(type) ⇒ Class

: (Type type) -> void



247
248
249
250
# File 'lib/rbi/type.rb', line 247

def initialize(type)
  super()
  @type = type
end

Instance Attribute Details

#typeObject (readonly)

: Type



244
245
246
# File 'lib/rbi/type.rb', line 244

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object

: (BasicObject other) -> bool



254
255
256
# File 'lib/rbi/type.rb', line 254

def ==(other)
  Class === other && @type == other.type
end

#normalizeObject

: -> Type



266
267
268
# File 'lib/rbi/type.rb', line 266

def normalize
  self
end

#simplifyObject

: -> Type



272
273
274
# File 'lib/rbi/type.rb', line 272

def simplify
  self
end

#to_rbiObject

: -> String



260
261
262
# File 'lib/rbi/type.rb', line 260

def to_rbi
  "T::Class[#{@type}]"
end