Class: VertxShell::CliToken

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb

Overview

A parsed token in the command line interface.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


17
18
19
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 17

def @@j_api_type.accept?(obj)
  obj.class == CliToken
end

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

Create a new blank token.

Parameters:

  • blank (String) (defaults to: nil)
    the blank value

Returns:

Raises:

  • (ArgumentError)


44
45
46
47
48
49
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 44

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:

Raises:

  • (ArgumentError)


35
36
37
38
39
40
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 35

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

+ (Object) j_api_type



26
27
28
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 26

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



29
30
31
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 29

def self.j_class
  Java::IoVertxExtShellCli::CliToken.java_class
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:

Raises:

  • (ArgumentError)


81
82
83
84
85
86
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 81

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

+ (Object) unwrap(obj)



23
24
25
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 23

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



20
21
22
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 20

def @@j_api_type.wrap(obj)
  CliToken.new(obj)
end

Instance Method Details

- (true, false) blank?

Returns true when it's a blank token

Returns:

  • (true, false)
    true when it's a blank token

Raises:

  • (ArgumentError)


72
73
74
75
76
77
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 72

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

- (String) raw

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

Returns:

  • (String)
    the raw token value, that may contain unescaped chars, for instance

Raises:

  • (ArgumentError)


58
59
60
61
62
63
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 58

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

- (true, false) text?

Returns true when it's a text token

Returns:

  • (true, false)
    true when it's a text token

Raises:

  • (ArgumentError)


65
66
67
68
69
70
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 65

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

- (String) value

Returns the token value

Returns:

  • (String)
    the token value

Raises:

  • (ArgumentError)


51
52
53
54
55
56
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/cli_token.rb', line 51

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