Class: Hive::PortReserver
- Inherits:
-
Object
- Object
- Hive::PortReserver
- Defined in:
- lib/hive/worker/ios.rb
Instance Attribute Summary collapse
-
#ports ⇒ Object
Returns the value of attribute ports.
Instance Method Summary collapse
-
#initialize ⇒ PortReserver
constructor
A new instance of PortReserver.
- #reserve(queue_name) ⇒ Object
Constructor Details
#initialize ⇒ PortReserver
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
#ports ⇒ Object
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 |