Class: CLI::Kit::Args::Tokenizer::Token

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/cli/kit/args/tokenizer.rb

Constant Summary collapse

OptionName =
Class.new(Token)
LongOptionName =
Class.new(OptionName)
ShortOptionName =
Class.new(OptionName)
OptionValue =
Class.new(Token)
PositionalArgument =
Class.new(Token)
OptionValueOrPositionalArgument =
Class.new(Token)
UnparsedArgument =
Class.new(Token)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from T::Sig

sig

Constructor Details

#initialize(value) ⇒ Token

Returns a new instance of Token.



36
37
38
# File 'lib/cli/kit/args/tokenizer.rb', line 36

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



33
34
35
# File 'lib/cli/kit/args/tokenizer.rb', line 33

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



46
47
48
# File 'lib/cli/kit/args/tokenizer.rb', line 46

def ==(other)
  self.class == other.class && @value == other.value
end

#inspectObject



41
42
43
# File 'lib/cli/kit/args/tokenizer.rb', line 41

def inspect
  "#<#{self.class.name} #{@value}>"
end