Class: CLI::Kit::Args::Parser::Node::Flag

Inherits:
CLI::Kit::Args::Parser::Node show all
Defined in:
lib/cli/kit/args/parser/node.rb

Direct Known Subclasses

LongFlag, ShortFlag

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from T::Sig

#sig

Constructor Details

#initialize(value) ⇒ Flag

Returns a new instance of Flag.



62
63
64
65
# File 'lib/cli/kit/args/parser/node.rb', line 62

def initialize(value)
  @value = value
  super()
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



59
60
61
# File 'lib/cli/kit/args/parser/node.rb', line 59

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



74
75
76
# File 'lib/cli/kit/args/parser/node.rb', line 74

def ==(other)
  !!(super(other) && @value == other.value)
end

#inspectObject



69
70
71
# File 'lib/cli/kit/args/parser/node.rb', line 69

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