Class: Bunny::Channel
Instance Attribute Summary
#active, #client, #frame_buffer, #number
Instance Method Summary
collapse
Constructor Details
#initialize(client) ⇒ Channel
Returns a new instance of Channel.
4
5
6
|
# File 'lib/ext/bunny-0.6.0/lib/bunny/channel08.rb', line 4
def initialize(client)
super
end
|
Instance Method Details
#close ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/ext/bunny-0.6.0/lib/bunny/channel08.rb', line 20
def close
client.channel = self
client.send_frame(
Qrack::Protocol::Channel::Close.new(:reply_code => 200, :reply_text => 'bye', :method_id => 0, :class_id => 0)
)
method = client.next_method
client.check_response(method, Qrack::Protocol::Channel::CloseOk, "Error closing channel #{number}")
@active = false
:close_ok
end
|
#open ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/ext/bunny-0.6.0/lib/bunny/channel08.rb', line 8
def open
client.channel = self
client.send_frame(Qrack::Protocol::Channel::Open.new)
method = client.next_method
client.check_response(method, Qrack::Protocol::Channel::OpenOk, "Cannot open channel #{number}")
@active = true
:open_ok
end
|
#open? ⇒ Boolean
34
35
36
|
# File 'lib/ext/bunny-0.6.0/lib/bunny/channel08.rb', line 34
def open?
active
end
|