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 7
def initialize(path:, absolute:) @path = path @absolute = absolute ? true : false end
Class Method Details
.empty
[ GitHub ]# File 'lib/rbs/namespace.rb', line 12
def self.empty @empty ||= new(path: [], absolute: false) end
.parse(string)
[ GitHub ].root
[ GitHub ]Instance Attribute Details
#absolute? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/namespace.rb', line 39
def absolute? @absolute end
#empty? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/namespace.rb', line 55
def empty? path.empty? end
#path (readonly)
[ GitHub ]# File 'lib/rbs/namespace.rb', line 5
attr_reader :path
#relative? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/namespace.rb', line 43
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 63
alias eql? ==