Class: VertxWeb::ParsedHeaderValues

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

Overview

A container with the request's headers that are meaningful enough to be parsed Contains:
  • Accept -> MIME header, parameters and sortable
  • Accept-Charset -> Parameters and sortable
  • Accept-Encoding -> Parameters and sortable
  • Accept-Language -> Parameters and sortable
  • Content-Type -> MIME header and parameters

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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

+ (Object) j_api_type



38
39
40
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_values.rb', line 38

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



41
42
43
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_values.rb', line 41

def self.j_class
  Java::IoVertxExtWeb::ParsedHeaderValues.java_class
end

+ (Object) unwrap(obj)



35
36
37
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_values.rb', line 35

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

+ (Object) wrap(obj)



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

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

Instance Method Details

- (Array<::VertxWeb::MIMEHeader>) accept

Returns List of MIME values in the Accept header

Returns:

Raises:

  • (ArgumentError)


45
46
47
48
49
50
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_values.rb', line 45

def accept
  if !block_given?
    return @j_del.java_method(:accept, []).call().to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxWeb::MIMEHeader) }
  end
  raise ArgumentError, "Invalid arguments when calling accept()"
end

- (Array<::VertxWeb::ParsedHeaderValue>) accept_charset

Returns List of charset values in the Accept-Charset header

Returns:

Raises:

  • (ArgumentError)


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

def accept_charset
  if !block_given?
    return @j_del.java_method(:acceptCharset, []).call().to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxWeb::ParsedHeaderValueImpl) }
  end
  raise ArgumentError, "Invalid arguments when calling accept_charset()"
end

- (Array<::VertxWeb::ParsedHeaderValue>) accept_encoding

Returns List of encofing values in the Accept-Encoding header

Returns:

Raises:

  • (ArgumentError)


59
60
61
62
63
64
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_values.rb', line 59

def accept_encoding
  if !block_given?
    return @j_del.java_method(:acceptEncoding, []).call().to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxWeb::ParsedHeaderValueImpl) }
  end
  raise ArgumentError, "Invalid arguments when calling accept_encoding()"
end

- (Array<::VertxWeb::LanguageHeader>) accept_language

Returns List of languages in the Accept-Language header

Returns:

Raises:

  • (ArgumentError)


66
67
68
69
70
71
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_values.rb', line 66

def accept_language
  if !block_given?
    return @j_del.java_method(:acceptLanguage, []).call().to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxWeb::LanguageHeader) }
  end
  raise ArgumentError, "Invalid arguments when calling accept_language()"
end

- (::VertxWeb::MIMEHeader) content_type

Returns MIME value in the Content-Type header

Returns:

Raises:

  • (ArgumentError)


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

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