Class List Method List File List

# Class: VertxWeb::CorsHandler

Inherits:
  Object
  - Object
  - VertxWeb::CorsHandler
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb

## Class Method Summary (collapse)

- + (Object) create(allowedOriginPattern = nil)

## Instance Method Summary (collapse)

- - (Object) allow_credentials(allow = nil)
- - (Object) allowed_header(headerName = nil)
- - (Object) allowed_headers(headerNames = nil)
- - (Object) allowed_method(method = nil)
- - (Object) exposed_header(headerName = nil)
- - (Object) exposed_headers(headerNames = nil)
- - (Object) handle(arg0 = nil)
- - (CorsHandler) initialize(j_del) constructor
  A new instance of CorsHandler.
- - (Object) j_del
- - (Object) max_age_seconds(maxAgeSeconds = nil)

## Constructor Details

### - (`CorsHandler`) initialize(j_del)

Returns a new instance of CorsHandler

    9
    10
    11
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 9

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(allowedOriginPattern = nil)

Raises:

- (`ArgumentError`)

    28
    29
    30
    31
    32
    33
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 28

    def self.create(allowedOriginPattern=nil)
      if allowedOriginPattern.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::CorsHandler.java_method(:create, [Java::java.lang.String.java_class]).call(allowedOriginPattern),::VertxWeb::CorsHandler)
      end
      raise ArgumentError, "Invalid arguments when calling create(allowedOriginPattern)"
    end

## Instance Method Details

### - (`Object`) allow_credentials(allow = nil)

Raises:

- (`ArgumentError`)

    87
    88
    89
    90
    91
    92
    93
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 87

    def allow_credentials(allow=nil)
      if (allow.class == TrueClass || allow.class == FalseClass) && !block_given?
        @j_del.java_method(:allowCredentials, [Java::boolean.java_class]).call(allow)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling allow_credentials(allow)"
    end

### - (`Object`) allowed_header(headerName = nil)

Raises:

- (`ArgumentError`)

    47
    48
    49
    50
    51
    52
    53
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 47

    def allowed_header(headerName=nil)
      if headerName.class == String && !block_given?
        @j_del.java_method(:allowedHeader, [Java::java.lang.String.java_class]).call(headerName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling allowed_header(headerName)"
    end

### - (`Object`) allowed_headers(headerNames = nil)

Raises:

- (`ArgumentError`)

    57
    58
    59
    60
    61
    62
    63
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 57

    def allowed_headers(headerNames=nil)
      if headerNames.class == Set && !block_given?
        @j_del.java_method(:allowedHeaders, [Java::JavaUtil::Set.java_class]).call(Java::JavaUtil::LinkedHashSet.new(headerNames.map { |element| element }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling allowed_headers(headerNames)"
    end

### - (`Object`) allowed_method(method = nil)

Raises:

- (`ArgumentError`)

    37
    38
    39
    40
    41
    42
    43
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 37

    def allowed_method(method=nil)
      if method.class == Symbol && !block_given?
        @j_del.java_method(:allowedMethod, [Java::IoVertxCoreHttp::HttpMethod.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(method))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling allowed_method(method)"
    end

### - (`Object`) exposed_header(headerName = nil)

Raises:

- (`ArgumentError`)

    67
    68
    69
    70
    71
    72
    73
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 67

    def exposed_header(headerName=nil)
      if headerName.class == String && !block_given?
        @j_del.java_method(:exposedHeader, [Java::java.lang.String.java_class]).call(headerName)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling exposed_header(headerName)"
    end

### - (`Object`) exposed_headers(headerNames = nil)

Raises:

- (`ArgumentError`)

    77
    78
    79
    80
    81
    82
    83
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 77

    def exposed_headers(headerNames=nil)
      if headerNames.class == Set && !block_given?
        @j_del.java_method(:exposedHeaders, [Java::JavaUtil::Set.java_class]).call(Java::JavaUtil::LinkedHashSet.new(headerNames.map { |element| element }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling exposed_headers(headerNames)"
    end

### - (`Object`) handle(arg0 = nil)

Raises:

- (`ArgumentError`)

    19
    20
    21
    22
    23
    24
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 19

    def handle(arg0=nil)
      if arg0.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:handle, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(arg0.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling handle(arg0)"
    end

### - (`Object`) j_del

    14
    15
    16
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 14

    def j_del
      @j_del
    end

### - (`Object`) max_age_seconds(maxAgeSeconds = nil)

Raises:

- (`ArgumentError`)

    97
    98
    99
    100
    101
    102
    103
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/cors_handler.rb', line 97

    def max_age_seconds(maxAgeSeconds=nil)
      if maxAgeSeconds.class == Fixnum && !block_given?
        @j_del.java_method(:maxAgeSeconds, [Java::int.java_class]).call(maxAgeSeconds)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling max_age_seconds(maxAgeSeconds)"
    end