Class: Hive::PortReserver

Inherits:
Object
  • Object
show all
Defined in:
lib/hive/worker/ios.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePortReserver

Returns a new instance of PortReserver.



9
10
11
# File 'lib/hive/worker/ios.rb', line 9

def initialize
  self.ports = {}
end

Instance Attribute Details

#portsObject

Returns the value of attribute ports.



8
9
10
# File 'lib/hive/worker/ios.rb', line 8

def ports
  @ports
end

Instance Method Details

#reserve(queue_name) ⇒ Object



13
14
15
16
# File 'lib/hive/worker/ios.rb', line 13

def reserve(queue_name)
  self.ports[queue_name] = yield
  self.ports[queue_name]
end