Class: RBS::Namespace
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/namespace.rb |
Class Method Summary
- .empty
- .new(path:, absolute:) ⇒ Namespace constructor
- .parse(string)
- .root
Instance Attribute Summary
- #absolute? ⇒ Boolean readonly
- #empty? ⇒ Boolean readonly
- #path readonly
- #relative? ⇒ Boolean readonly
Instance Method Summary
- #+(other)
- #==(other) (also: #eql?)
- #absolute!
- #append(component)
- #ascend
-
#eql?(other)
Alias for #==.
- #hash
- #parent
- #relative!
- #split
- #to_s
- #to_type_name
Constructor Details
.new(path:, absolute:) ⇒ Namespace
# File 'lib/rbs/namespace.rb', line 5
def initialize(path:, absolute:) @path = path @absolute = absolute end
Class Method Details
.empty
[ GitHub ]# File 'lib/rbs/namespace.rb', line 10
def self.empty new(path: [], absolute: false) end
.parse(string)
[ GitHub ].root
[ GitHub ]Instance Attribute Details
#absolute? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/namespace.rb', line 35
def absolute? @absolute end
#empty? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/namespace.rb', line 51
def empty? path.empty? end
#path (readonly)
[ GitHub ]# File 'lib/rbs/namespace.rb', line 3
attr_reader :path
#relative? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/namespace.rb', line 39
def relative? !absolute? end
Instance Method Details
#+(other)
[ GitHub ]#==(other) Also known as: #eql?
[ GitHub ]#absolute!
[ GitHub ]#append(component)
[ GitHub ]#ascend
[ GitHub ]#eql?(other)
Alias for #==.
# File 'lib/rbs/namespace.rb', line 59
alias eql? ==