Class List Method List File List

# Class: VertxShell::CliToken

Inherits:
  Object
  - Object
  - VertxShell::CliToken
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/cli_token.rb

## Overview

A parsed token in the command line interface.

## Class Method Summary (collapse)

- + (::VertxShell::CliToken) create_blank(blank = nil)
  Create a new blank token.
- + (::VertxShell::CliToken) create_text(text = nil)
  Create a text token.
- + (Array<::VertxShell::CliToken>) tokenize(s = nil)
  Tokenize the string argument and return a list of tokens.

## Instance Method Summary (collapse)

- - (true, false) blank?
  @return true when it's a blank token.
- - (String) raw
  @return the raw token value, that may contain unescaped chars, for instance.
- - (true, false) text?
  @return true when it's a text token.
- - (String) value
  @return the token value.

## Class Method Details

### + (`::VertxShell::CliToken`) create_blank(blank = nil)

Create a new blank token.

Parameters:

- blank (`String`) (defaults to: `nil`) —
  the blank value

Returns:

- (`::VertxShell::CliToken`) —
  the token

Raises:

- (`ArgumentError`)

    28
    29
    30
    31
    32
    33
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/cli_token.rb', line 28

    def self.create_blank(blank=nil)
      if blank.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellCli::CliToken.java_method(:createBlank, [Java::java.lang.String.java_class]).call(blank),::VertxShell::CliToken)
      end
      raise ArgumentError, "Invalid arguments when calling create_blank(blank)"
    end

### + (`::VertxShell::CliToken`) create_text(text = nil)

Create a text token.

Parameters:

- text (`String`) (defaults to: `nil`) —
  the text

Returns:

- (`::VertxShell::CliToken`) —
  the token

Raises:

- (`ArgumentError`)

    19
    20
    21
    22
    23
    24
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/cli_token.rb', line 19

    def self.create_text(text=nil)
      if text.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtShellCli::CliToken.java_method(:createText, [Java::java.lang.String.java_class]).call(text),::VertxShell::CliToken)
      end
      raise ArgumentError, "Invalid arguments when calling create_text(text)"
    end

### + (`Array<::VertxShell::CliToken>`) tokenize(s = nil)

Tokenize the string argument and return a list of tokens.

Parameters:

- s (`String`) (defaults to: `nil`) —
  the tokenized string

Returns:

- (`Array<::VertxShell::CliToken>`) —
  the tokens

Raises:

- (`ArgumentError`)

    69
    70
    71
    72
    73
    74
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/cli_token.rb', line 69

    def self.tokenize(s=nil)
      if s.class == String && !block_given?
        return Java::IoVertxExtShellCli::CliToken.java_method(:tokenize, [Java::java.lang.String.java_class]).call(s).to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxShell::CliToken) }
      end
      raise ArgumentError, "Invalid arguments when calling tokenize(s)"
    end

## Instance Method Details

### - (`true`, `false`) blank?

@return true when it's a blank token

Returns:

- (`true`, `false`)

Raises:

- (`ArgumentError`)

    60
    61
    62
    63
    64
    65
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/cli_token.rb', line 60

    def blank?
      if !block_given?
        return @j_del.java_method(:isBlank, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling blank?()"
    end

### - (`String`) raw

@return the raw token value, that may contain unescaped chars, for instance

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    44
    45
    46
    47
    48
    49
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/cli_token.rb', line 44

    def raw
      if !block_given?
        return @j_del.java_method(:raw, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling raw()"
    end

### - (`true`, `false`) text?

@return true when it's a text token

Returns:

- (`true`, `false`)

Raises:

- (`ArgumentError`)

    52
    53
    54
    55
    56
    57
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/cli_token.rb', line 52

    def text?
      if !block_given?
        return @j_del.java_method(:isText, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling text?()"
    end

### - (`String`) value

@return the token value

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    36
    37
    38
    39
    40
    41
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/cli_token.rb', line 36

    def value
      if !block_given?
        return @j_del.java_method(:value, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling value()"
    end