Class: VertxShell::Shell

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

Overview

An interactive session between a consumer and a shell.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



33
34
35
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-shell/shell.rb', line 33

def self.j_class
  Java::IoVertxExtShell::Shell.java_class
end

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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

Instance Method Details

- (void) close

This method returns an undefined value.

Close the shell.

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/shell.rb', line 81

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

- (::VertxShell::Job) createJob(line) - (::VertxShell::Job) createJob(line)

Overloads:

Returns:

Raises:

  • (ArgumentError)


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

def create_job(param_1=nil)
  if param_1.class == Array && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createJob, [Java::JavaUtil::List.java_class]).call(param_1.map { |element| element.j_del }),::VertxShell::Job)
  elsif param_1.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:createJob, [Java::java.lang.String.java_class]).call(param_1),::VertxShell::Job)
  end
  raise ArgumentError, "Invalid arguments when calling create_job(#{param_1})"
end

- (::VertxShell::JobController) job_controller

Returns the shell's job controller

Returns:

Raises:

  • (ArgumentError)


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

def job_controller
  if !block_given?
    if @cached_job_controller != nil
      return @cached_job_controller
    end
    return @cached_job_controller = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:jobController, []).call(),::VertxShell::JobController)
  end
  raise ArgumentError, "Invalid arguments when calling job_controller()"
end

- (::VertxShell::Session) session

Returns the current shell session

Returns:

Raises:

  • (ArgumentError)


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

def session
  if !block_given?
    if @cached_session != nil
      return @cached_session
    end
    return @cached_session = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:session, []).call(),::VertxShell::Session)
  end
  raise ArgumentError, "Invalid arguments when calling session()"
end

- (void) set_prompt(prompt = nil) { ... }

This method returns an undefined value.

Set a new prompt in this session.

Yields:

  • the new prompt will be calculated when it's needed.

Raises:

  • (ArgumentError)


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

def set_prompt(prompt=nil)
  if block_given? && prompt == nil
    return @j_del.java_method(:setPrompt, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxShell::Session)) }))
  end
  raise ArgumentError, "Invalid arguments when calling set_prompt(#{prompt})"
end