Class: Cliqr::Parser::ArgumentToken Private

Inherits:
Token
  • Object
show all
Defined in:
lib/cliqr/parser/argument_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 arbitrary argument value

Instance Attribute Summary

Attributes inherited from Token

#arg

Instance Method Summary collapse

Methods inherited from Token

#active?, #collect

Constructor Details

#initialize(arg) ⇒ ArgumentToken

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 argument token



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

def initialize(arg)
  super(arg)
end

Instance Method Details

#valid?Boolean

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.

This token is valid if argument is non-empty

Returns:

  • (Boolean)

    true if token’s argument is non-empty



17
18
19
20
# File 'lib/cliqr/parser/argument_token.rb', line 17

def valid?
  return false if arg.nil?
  !arg.empty?
end