class Flame::Path::PathPart

Class for one part of Path

Constants

ARG_CHAR
ARG_CHAR_OPT

Public Class Methods

new(part, arg: false) click to toggle source
# File lib/flame/path.rb, line 139
def initialize(part, arg: false)
        @part = "#{ARG_CHAR if arg}#{ARG_CHAR_OPT if arg == :opt}#{part}"
end

Public Instance Methods

==(other) click to toggle source
# File lib/flame/path.rb, line 148
def ==(other)
        to_s == other.to_s
end
Also aliased as: eql?
arg?() click to toggle source
# File lib/flame/path.rb, line 158
def arg?
        @part.start_with? ARG_CHAR
end
clean() click to toggle source
# File lib/flame/path.rb, line 166
def clean
        @part.delete ARG_CHAR + ARG_CHAR_OPT
end
eql?(other)
Alias for: ==
freeze() click to toggle source
Calls superclass method
# File lib/flame/path.rb, line 143
def freeze
        @part.freeze
        super
end
opt_arg?() click to toggle source
# File lib/flame/path.rb, line 162
def opt_arg?
        @part[1] == ARG_CHAR_OPT
end
to_s() click to toggle source
# File lib/flame/path.rb, line 154
def to_s
        @part
end