Class: RBI::Type::Simple
Overview
A type that represents a simple class name like ‘String` or `Foo`.
It can also be a qualified name like ‘::Foo` or `Foo::Bar`.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
: String.
Instance Method Summary collapse
-
#==(other) ⇒ Object
: (BasicObject other) -> bool.
-
#initialize(name) ⇒ Simple
constructor
: (String 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) ⇒ Simple
: (String name) -> void
22 23 24 25 |
# File 'lib/rbi/type.rb', line 22 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
: String
19 20 21 |
# File 'lib/rbi/type.rb', line 19 def name @name end |
Instance Method Details
#==(other) ⇒ Object
: (BasicObject other) -> bool
29 30 31 |
# File 'lib/rbi/type.rb', line 29 def ==(other) Simple === other && @name == other.name end |
#to_rbi ⇒ Object
: -> String
35 36 37 |
# File 'lib/rbi/type.rb', line 35 def to_rbi @name end |