Class: RBI::Type::Class

Inherits:
RBI::Type show all
Extended by:
T::Sig
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

Returns a new instance of Class.



157
158
159
160
# File 'lib/rbi/type.rb', line 157

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

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



154
155
156
# File 'lib/rbi/type.rb', line 154

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



163
164
165
# File 'lib/rbi/type.rb', line 163

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

#to_rbiObject



168
169
170
# File 'lib/rbi/type.rb', line 168

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