Class: RBS::TypeName
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/type_name.rb |
Class Method Summary
- .new(namespace:, name:) ⇒ TypeName constructor
Instance Attribute Summary
- #absolute? ⇒ Boolean readonly
- #alias? ⇒ Boolean readonly
- #class? ⇒ Boolean readonly
- #interface? ⇒ Boolean readonly
- #kind readonly
- #name readonly
- #namespace readonly
Instance Method Summary
- #+(other)
- #==(other) (also: #eql?)
- #absolute!
-
#eql?(other)
Alias for #==.
- #hash
- #relative!
- #split
- #to_json(state = _ = nil)
- #to_namespace
- #to_s
- #with_prefix(namespace)
Constructor Details
.new(namespace:, name:) ⇒ TypeName
Instance Attribute Details
#absolute? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/type_name.rb', line 59
def absolute? namespace.absolute? end
#alias? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/type_name.rb', line 51
def alias? kind == :alias end
#class? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/type_name.rb', line 47
def class? kind == :class end
#interface? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/type_name.rb', line 67
def interface? kind == :interface end
#kind (readonly)
[ GitHub ]# File 'lib/rbs/type_name.rb', line 7
attr_reader :kind
#name (readonly)
[ GitHub ]# File 'lib/rbs/type_name.rb', line 6
attr_reader :name
#namespace (readonly)
[ GitHub ]# File 'lib/rbs/type_name.rb', line 5
attr_reader :namespace
Instance Method Details
#+(other)
[ GitHub ]# File 'lib/rbs/type_name.rb', line 79
def +(other) if other.absolute? other else TypeName.new( namespace: self.to_namespace + other.namespace, name: other.name ) end end
#==(other) Also known as: #eql?
[ GitHub ]#absolute!
[ GitHub ]#eql?(other)
Alias for #==.
# File 'lib/rbs/type_name.rb', line 29
alias eql? ==
#hash
[ GitHub ]#relative!
[ GitHub ]#split
[ GitHub ]#to_json(state = _ = nil)
[ GitHub ]# File 'lib/rbs/type_name.rb', line 39
def to_json(state = _ = nil) to_s.to_json(state) end