Class List Method List File List

# Class: VertxServiceDiscovery::ServiceReference

Inherits:
  Object
  - Object
  - VertxServiceDiscovery::ServiceReference
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_reference.rb

## Instance Method Summary (collapse)

- - (Object) cached
- - (Object) get
- - (ServiceReference) initialize(j_del) constructor
  A new instance of ServiceReference.
- - (Object) j_del
- - (Object) record
- - (Object) release

## Constructor Details

### - (`ServiceReference`) initialize(j_del)

Returns a new instance of ServiceReference

    13
    14
    15
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_reference.rb', line 13

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) cached

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_reference.rb', line 42

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

### - (`Object`) get

Raises:

- (`ArgumentError`)

    34
    35
    36
    37
    38
    39
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_reference.rb', line 34

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

### - (`Object`) j_del

    18
    19
    20
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_reference.rb', line 18

    def j_del
      @j_del
    end

### - (`Object`) record

Raises:

- (`ArgumentError`)

    22
    23
    24
    25
    26
    27
    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_reference.rb', line 22

    def record
      if !block_given?
        if @cached_record != nil
          return @cached_record
        end
        return @cached_record = @j_del.java_method(:record, []).call() != nil ? JSON.parse(@j_del.java_method(:record, []).call().toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling record()"
    end

### - (`Object`) release

Raises:

- (`ArgumentError`)

    51
    52
    53
    54
    55
    56
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_reference.rb', line 51

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