Class: VertxWeb::MIMEHeader
- Inherits:
-
Object
- Object
- VertxWeb::MIMEHeader
- Includes:
- ParsedHeaderValue
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
-
+ (Object) DEFAULT_WEIGHT
If no "q" parameter is present, the default weight is 1.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (String) component
Gets the parsed component part of the MIME.
-
- (true, false) isMatchedBy(matchTry)
Test if this header is matched by matchTry header.
-
- (String) parameter(key)
The value of the parameter specified by this key.
-
- (Hash{String => String}) parameters
The parameters specified in this header value.
-
- (true, false) isPermitted
Is this an allowed operation as specified by the corresponding header?.
-
- (String) rawValue
Contains the raw value that was received from the user agent.
-
- (String) subComponent
Gets the parsed subcomponent part of the MIME.
-
- (String) value
Holds the unparsed value of the header.
-
- (Float) weight
Holds the weight specified in the "q" parameter of the header.
-
- (Fixnum) weightedOrder
An integer that represents the absolute order position of this header.
Class Method Details
+ (Boolean) accept?(obj)
19 20 21 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 19 def @@j_api_type.accept?(obj) obj.class == MIMEHeader end |
+ (Object) DEFAULT_WEIGHT
If no "q" parameter is present, the default weight is 1.
179 180 181 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 179 def self.DEFAULT_WEIGHT Java::IoVertxExtWeb::MIMEHeader.DEFAULT_WEIGHT end |
+ (Object) j_api_type
28 29 30 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 28 def self.j_api_type @@j_api_type end |
+ (Object) j_class
31 32 33 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 31 def self.j_class Java::IoVertxExtWeb::MIMEHeader.java_class end |
+ (Object) unwrap(obj)
25 26 27 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 25 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
22 23 24 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 22 def @@j_api_type.wrap(obj) MIMEHeader.new(obj) end |
Instance Method Details
- (String) component
Gets the parsed component part of the MIME. This is the string between the beginning and the first
'/'
of the MIME
51 52 53 54 55 56 57 58 59 60 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 51 def component if !block_given? return @j_del.java_method(:component, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling component()" end end |
- (true, false) isMatchedBy(matchTry)
Test if this header is matched by matchTry header
168 169 170 171 172 173 174 175 176 177 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 168 def matched_by?(*args) if args[0].class.method_defined?(:j_del) && !block_given? return @j_del.java_method(:isMatchedBy, [Java::IoVertxExtWeb::ParsedHeaderValue.java_class]).call(args[0].j_del) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling matched_by?(#{args[0]})" end end |
- (String) parameter(key)
The value of the parameter specified by this key. Each is one of 3 things:
- null <- That key was not specified
- ParsedHeaderValue.EMPTY (tested using ==) <- The value was not specified
- [Other] <- The value of the parameter
q
parameter is never present.
97 98 99 100 101 102 103 104 105 106 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 97 def parameter(*args) if args[0].class == String && !block_given? return @j_del.java_method(:parameter, [Java::java.lang.String.java_class]).call(args[0]) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling parameter(#{args[0]})" end end |
- (Hash{String => String}) parameters
The parameters specified in this header value.
Note: The
q
parameter is never present.
140 141 142 143 144 145 146 147 148 149 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 140 def parameters if !block_given? return Java::IoVertxLangRuby::Helper.adaptingMap(@j_del.java_method(:parameters, []).call(), Proc.new { |val| val }, Proc.new { |val| ::Vertx::Util::Utils.to_string(val) }) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling parameters()" end end |
- (true, false) isPermitted
Is this an allowed operation as specified by the corresponding header?
77 78 79 80 81 82 83 84 85 86 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 77 def permitted? if !block_given? return @j_del.java_method(:isPermitted, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling permitted?()" end end |
- (String) rawValue
Contains the raw value that was received from the user agent
64 65 66 67 68 69 70 71 72 73 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 64 def raw_value if !block_given? return @j_del.java_method(:rawValue, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling raw_value()" end end |
- (String) subComponent
Gets the parsed subcomponent part of the MIME. This is the string between the first
'/'
and the
';'
or the end of the MIME
126 127 128 129 130 131 132 133 134 135 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 126 def sub_component if !block_given? return @j_del.java_method(:subComponent, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling sub_component()" end end |
- (String) value
Holds the unparsed value of the header.
For the most part, this is the content before the semi-colon (";")
For the most part, this is the content before the semi-colon (";")
154 155 156 157 158 159 160 161 162 163 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 154 def value if !block_given? return @j_del.java_method(:value, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling value()" end end |
- (Float) weight
Holds the weight specified in the "q" parameter of the header.
If the parameter is not specified, 1.0 is assumed according to rfc7231
If the parameter is not specified, 1.0 is assumed according to rfc7231
112 113 114 115 116 117 118 119 120 121 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 112 def weight if !block_given? return @j_del.java_method(:weight, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling weight()" end end |
- (Fixnum) weightedOrder
An integer that represents the absolute order position of this header
37 38 39 40 41 42 43 44 45 46 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/mime_header.rb', line 37 def weighted_order if !block_given? return @j_del.java_method(:weightedOrder, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling weighted_order()" end end |