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

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(value) ⇒ Token

: (String value) -> void



30
31
32
# File 'lib/cli/kit/args/tokenizer.rb', line 30

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

: String



27
28
29
# File 'lib/cli/kit/args/tokenizer.rb', line 27

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object

: (untyped other) -> bool



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

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

#inspectObject

: -> String



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

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