Class: Cliqr::Parser::BooleanOptionToken Private

Inherits:
OptionToken show all
Defined in:
lib/cliqr/parser/boolean_option_token.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Token handler for parsing a boolean option

Instance Attribute Summary

Attributes inherited from OptionToken

#name, #value

Attributes inherited from Token

#arg

Instance Method Summary collapse

Methods inherited from OptionToken

#build, #collect, #valid?

Methods inherited from Token

#active?, #collect

Constructor Details

#initialize(name, arg) ⇒ BooleanOptionToken

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a new option token to store boolean value



10
11
12
13
# File 'lib/cliqr/parser/boolean_option_token.rb', line 10

def initialize(name, arg)
  super(name, arg)
  @value = !arg.to_s.start_with?('--no-')
end