Class: BunnyHair::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/bunny_hair/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connectedObject

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

Returns:

  • (Boolean)


5
6
7
# File 'lib/bunny_hair/connection.rb', line 5

def connected?
  !!connected
end

#create_channelObject



17
18
19
# File 'lib/bunny_hair/connection.rb', line 17

def create_channel
  Channel.new(self)
end

#default_channelObject



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

#startObject



9
10
11
# File 'lib/bunny_hair/connection.rb', line 9

def start
  self.connected = true
end

#stopObject



13
14
15
# File 'lib/bunny_hair/connection.rb', line 13

def stop
  self.connected = false
end