Class: Protocol::HTTP2::Priority
- Inherits:
-
Struct
- Object
- Struct
- Protocol::HTTP2::Priority
- Defined in:
- lib/protocol/http2/priority_frame.rb
Constant Summary collapse
- FORMAT =
"NC".freeze
- EXCLUSIVE =
1 << 31
Instance Attribute Summary collapse
-
#exclusive ⇒ Object
Returns the value of attribute exclusive.
-
#stream_dependency ⇒ Object
Returns the value of attribute stream_dependency.
-
#weight ⇒ Object
Returns the value of attribute weight.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#exclusive ⇒ Object
Returns the value of attribute exclusive
25 26 27 |
# File 'lib/protocol/http2/priority_frame.rb', line 25 def exclusive @exclusive end |
#stream_dependency ⇒ Object
Returns the value of attribute stream_dependency
25 26 27 |
# File 'lib/protocol/http2/priority_frame.rb', line 25 def stream_dependency @stream_dependency end |
#weight ⇒ Object
Returns the value of attribute weight
25 26 27 |
# File 'lib/protocol/http2/priority_frame.rb', line 25 def weight @weight end |
Class Method Details
.unpack(data) ⇒ Object
29 30 31 32 33 |
# File 'lib/protocol/http2/priority_frame.rb', line 29 def self.unpack(data) stream_dependency, weight = data.unpack(FORMAT) return self.new(stream_dependency & EXCLUSIVE != 0, stream_dependency & ~EXCLUSIVE, weight) end |
Instance Method Details
#pack ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/protocol/http2/priority_frame.rb', line 35 def pack if exclusive stream_dependency = self.stream_dependency | EXCLUSIVE end return [stream_dependency, self.weight].pack(FORMAT) end |