Class: Biryani::Frame::Continuation
- Inherits:
-
Object
- Object
- Biryani::Frame::Continuation
- Defined in:
- lib/biryani/frame/continuation.rb
Instance Attribute Summary collapse
-
#f_type ⇒ Object
readonly
Returns the value of attribute f_type.
-
#fragment ⇒ Object
readonly
Returns the value of attribute fragment.
-
#stream_id ⇒ Object
readonly
Returns the value of attribute stream_id.
Class Method Summary collapse
Instance Method Summary collapse
- #end_headers? ⇒ Boolean
-
#initialize(end_headers, stream_id, fragment) ⇒ Continuation
constructor
A new instance of Continuation.
- #length ⇒ Integer
- #to_binary_s ⇒ String
Constructor Details
#initialize(end_headers, stream_id, fragment) ⇒ Continuation
Returns a new instance of Continuation.
9 10 11 12 13 14 |
# File 'lib/biryani/frame/continuation.rb', line 9 def initialize(end_headers, stream_id, fragment) @f_type = FrameType::CONTINUATION @end_headers = end_headers @stream_id = stream_id @fragment = fragment end |
Instance Attribute Details
#f_type ⇒ Object (readonly)
Returns the value of attribute f_type.
4 5 6 |
# File 'lib/biryani/frame/continuation.rb', line 4 def f_type @f_type end |
#fragment ⇒ Object (readonly)
Returns the value of attribute fragment.
4 5 6 |
# File 'lib/biryani/frame/continuation.rb', line 4 def fragment @fragment end |
#stream_id ⇒ Object (readonly)
Returns the value of attribute stream_id.
4 5 6 |
# File 'lib/biryani/frame/continuation.rb', line 4 def stream_id @stream_id end |
Class Method Details
.read(s, flags, stream_id) ⇒ Continuation
39 40 41 42 |
# File 'lib/biryani/frame/continuation.rb', line 39 def self.read(s, flags, stream_id) end_headers = Frame.read_end_headers(flags) Continuation.new(end_headers, stream_id, s) end |
Instance Method Details
#end_headers? ⇒ Boolean
17 18 19 |
# File 'lib/biryani/frame/continuation.rb', line 17 def end_headers? @end_headers end |
#length ⇒ Integer
22 23 24 |
# File 'lib/biryani/frame/continuation.rb', line 22 def length @fragment.bytesize end |
#to_binary_s ⇒ String
27 28 29 30 31 32 |
# File 'lib/biryani/frame/continuation.rb', line 27 def to_binary_s payload_length = length flags = Frame.to_flags(end_headers: end_headers?) Frame.to_binary_s_header(payload_length, @f_type, flags, @stream_id) + @fragment end |