Class: BunnyHair::Connection
- Inherits:
-
Object
- Object
- BunnyHair::Connection
- Defined in:
- lib/bunny_hair/connection.rb
Instance Attribute Summary collapse
-
#connected ⇒ Object
Returns the value of attribute connected.
Instance Method Summary collapse
- #connected? ⇒ Boolean
- #create_channel ⇒ Object
- #default_channel ⇒ Object
- #reset_all! ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Instance Attribute Details
#connected ⇒ Object
Returns the value of attribute connected.
3 4 5 |
# File 'lib/bunny_hair/connection.rb', line 3 def connected @connected end |
Instance Method Details
#connected? ⇒ Boolean
5 6 7 |
# File 'lib/bunny_hair/connection.rb', line 5 def connected? !!connected end |
#create_channel ⇒ Object
17 18 19 |
# File 'lib/bunny_hair/connection.rb', line 17 def create_channel Channel.new(self) end |
#default_channel ⇒ Object
21 22 23 |
# File 'lib/bunny_hair/connection.rb', line 21 def default_channel @channel ||= Channel.new(self) end |
#reset_all! ⇒ Object
25 26 27 |
# File 'lib/bunny_hair/connection.rb', line 25 def reset_all! @channel = nil end |
#start ⇒ Object
9 10 11 |
# File 'lib/bunny_hair/connection.rb', line 9 def start self.connected = true end |
#stop ⇒ Object
13 14 15 |
# File 'lib/bunny_hair/connection.rb', line 13 def stop self.connected = false end |