Class: RBI::Type::Simple
- Inherits:
-
Type
- Object
- Type
- RBI::Type::Simple
- Defined in:
- lib/rbi/type.rb
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.
-
#normalize ⇒ Object
: -> Type.
-
#simplify ⇒ Object
: -> Type.
-
#to_rbi ⇒ Object
: -> String.
Constructor Details
#initialize(name) ⇒ Simple
: (String name) -> void
18 19 20 21 |
# File 'lib/rbi/type.rb', line 18 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
: String
15 16 17 |
# File 'lib/rbi/type.rb', line 15 def name @name end |
Instance Method Details
#==(other) ⇒ Object
: (BasicObject other) -> bool
25 26 27 |
# File 'lib/rbi/type.rb', line 25 def ==(other) Simple === other && @name == other.name end |
#normalize ⇒ Object
: -> Type
37 38 39 |
# File 'lib/rbi/type.rb', line 37 def normalize self end |
#simplify ⇒ Object
: -> Type
43 44 45 |
# File 'lib/rbi/type.rb', line 43 def simplify self end |
#to_rbi ⇒ Object
: -> String
31 32 33 |
# File 'lib/rbi/type.rb', line 31 def to_rbi @name end |