Class: Biryani::Frame::Unknown

Inherits:
Object
  • Object
show all
Defined in:
lib/biryani/frame/unknown.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(f_type, flags, stream_id, payload) ⇒ Unknown

Returns a new instance of Unknown.

Parameters:

  • f_type (Integer)
  • flags (Integer)
  • stream_id (Integer)
  • payload (String, nil)


10
11
12
13
14
15
# File 'lib/biryani/frame/unknown.rb', line 10

def initialize(f_type, flags, stream_id, payload)
  @f_type = f_type
  @flags = flags
  @stream_id = stream_id
  @payload = payload
end

Instance Attribute Details

#f_typeObject (readonly)

Returns the value of attribute f_type.



4
5
6
# File 'lib/biryani/frame/unknown.rb', line 4

def f_type
  @f_type
end

#flagsObject (readonly)

Returns the value of attribute flags.



4
5
6
# File 'lib/biryani/frame/unknown.rb', line 4

def flags
  @flags
end

#payloadObject (readonly)

Returns the value of attribute payload.



4
5
6
# File 'lib/biryani/frame/unknown.rb', line 4

def payload
  @payload
end

#stream_idObject (readonly)

Returns the value of attribute stream_id.



4
5
6
# File 'lib/biryani/frame/unknown.rb', line 4

def stream_id
  @stream_id
end

Instance Method Details

#lengthInteger

Returns:

  • (Integer)


18
19
20
# File 'lib/biryani/frame/unknown.rb', line 18

def length
  @payload.bytesize
end

#to_binary_sString

Returns:

  • (String)


23
24
25
# File 'lib/biryani/frame/unknown.rb', line 23

def to_binary_s
  Frame.to_binary_s_header(length, @f_type, @flags, @stream_id) + @payload
end