Class: Baykit::BayServer::Docker::Http::H2::H2Command

Inherits:
Protocol::Command
  • Object
show all
Includes:
Baykit::BayServer::Docker::Http, Baykit::BayServer::Docker::Http::H2
Defined in:
lib/baykit/bayserver/docker/http/h2/h2_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, stream_id, flags = nil) ⇒ H2Command

Returns a new instance of H2Command.



15
16
17
18
19
20
21
22
23
# File 'lib/baykit/bayserver/docker/http/h2/h2_command.rb', line 15

def initialize(type, stream_id, flags=nil)
  super type
  @stream_id = stream_id
  if flags == nil
    @flags = H2Flags.new
  else
    @flags = flags
  end
end

Instance Attribute Details

#flagsObject (readonly)

Returns the value of attribute flags.



12
13
14
# File 'lib/baykit/bayserver/docker/http/h2/h2_command.rb', line 12

def flags
  @flags
end

#stream_idObject

Returns the value of attribute stream_id.



13
14
15
# File 'lib/baykit/bayserver/docker/http/h2/h2_command.rb', line 13

def stream_id
  @stream_id
end

Instance Method Details

#pack(pkt) ⇒ Object



30
31
32
33
34
# File 'lib/baykit/bayserver/docker/http/h2/h2_command.rb', line 30

def pack(pkt)
  pkt.stream_id = @stream_id
  pkt.flags = @flags
  pkt.pack_header
end

#unpack(pkt) ⇒ Object



25
26
27
28
# File 'lib/baykit/bayserver/docker/http/h2/h2_command.rb', line 25

def unpack(pkt)
  @stream_id = pkt.stream_id
  @flags = pkt.flags
end