Class: VertxShell::CliToken
- Inherits:
-
Object
- Object
- VertxShell::CliToken
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)
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
|
Create a new blank token.
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
|
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
|
Tokenize the string argument and return a list of tokens.
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
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
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
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
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
|