Class List Method List File List

# Class: VertxAuthCommon::User

Inherits:
  Object
  - Object
  - VertxAuthCommon::User
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-common/user.rb

## Direct Known Subclasses

VertxAuthOauth2::AccessToken

## Instance Method Summary (collapse)

- - (Object) clear_cache
- - (User) initialize(j_del) constructor
  A new instance of User.
- - (Object) is_authorised(authority = nil)
- - (Object) j_del
- - (Object) principal
- - (Object) set_auth_provider(authProvider = nil)

## Constructor Details

### - (`User`) initialize(j_del)

Returns a new instance of User

    11
    12
    13
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-common/user.rb', line 11

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) clear_cache

Raises:

- (`ArgumentError`)

    33
    34
    35
    36
    37
    38
    39
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-common/user.rb', line 33

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

### - (`Object`) is_authorised(authority = nil)

Raises:

- (`ArgumentError`)

    23
    24
    25
    26
    27
    28
    29
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-common/user.rb', line 23

    def is_authorised(authority=nil)
      if authority.class == String && block_given?
        @j_del.java_method(:isAuthorised, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(authority,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling is_authorised(authority)"
    end

### - (`Object`) j_del

    16
    17
    18
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-common/user.rb', line 16

    def j_del
      @j_del
    end

### - (`Object`) principal

Raises:

- (`ArgumentError`)

    48
    49
    50
    51
    52
    53
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-common/user.rb', line 48

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

### - (`Object`) set_auth_provider(authProvider = nil)

Raises:

- (`ArgumentError`)

    58
    59
    60
    61
    62
    63
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-common/user.rb', line 58

    def set_auth_provider(authProvider=nil)
      if authProvider.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:setAuthProvider, [Java::IoVertxExtAuth::AuthProvider.java_class]).call(authProvider.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling set_auth_provider(authProvider)"
    end