Class List Method List File List

# Class: VertxShell::Shell

Inherits:
  Object
  - Object
  - VertxShell::Shell
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/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)

- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) close
  Close the shell.
- - (::VertxShell::Job) create_job(param_1 = nil)
  See #create_job.
- - (::VertxShell::JobController) job_controller
  The shell's job controller.
- - (::VertxShell::Session) session
  The current shell session.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/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-stack/stack-docs/target/rb/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-stack/stack-docs/target/rb/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-stack/stack-docs/target/rb/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-stack/stack-docs/target/rb/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`)

    72
    73
    74
    75
    76
    77
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-shell/shell.rb', line 72

    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)

See #create_job

Overloads:

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

  Parameters:

  - line (`Array<::VertxShell::CliToken>`) —
    the command line creating this job
- - (`::VertxShell::Job`) createJob(line)

  Parameters:

  - line (`String`)

Returns:

- (`::VertxShell::Job`)

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    48
    49
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/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:

- (`::VertxShell::JobController`) —
  the shell's job controller

Raises:

- (`ArgumentError`)

    51
    52
    53
    54
    55
    56
    57
    58
    59
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/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:

- (`::VertxShell::Session`) —
  the current shell session

Raises:

- (`ArgumentError`)

    61
    62
    63
    64
    65
    66
    67
    68
    69
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/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