Class: RBI::Type::Class
Overview
The class of another type like ‘T::Class`.
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
: Type.
Instance Method Summary collapse
-
#==(other) ⇒ Object
: (BasicObject other) -> bool.
-
#initialize(type) ⇒ Class
constructor
: (Type type) -> 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(type) ⇒ Class
: (Type type) -> void
155 156 157 158 |
# File 'lib/rbi/type.rb', line 155 def initialize(type) super() @type = type end |
Instance Attribute Details
#type ⇒ Object (readonly)
: Type
152 153 154 |
# File 'lib/rbi/type.rb', line 152 def type @type end |
Instance Method Details
#==(other) ⇒ Object
: (BasicObject other) -> bool
162 163 164 |
# File 'lib/rbi/type.rb', line 162 def ==(other) Class === other && @type == other.type end |
#to_rbi ⇒ Object
: -> String
168 169 170 |
# File 'lib/rbi/type.rb', line 168 def to_rbi "T::Class[#{@type}]" end |