Class: Punchblock::Component::ComponentNode
- Inherits:
-
Object
- Object
- Punchblock::Component::ComponentNode
- Defined in:
- lib/cucumber-voip/core_ext/punchblock/component/component_node.rb
Instance Attribute Summary collapse
-
#event_queue ⇒ Object
Returns the value of attribute event_queue.
Instance Method Summary collapse
-
#initialize(*args) ⇒ ComponentNode
constructor
A new instance of ComponentNode.
- #next_event(timeout = nil) ⇒ Object
Constructor Details
#initialize(*args) ⇒ ComponentNode
Returns a new instance of ComponentNode.
6 7 8 9 10 11 12 |
# File 'lib/cucumber-voip/core_ext/punchblock/component/component_node.rb', line 6 def initialize(*args) super @event_queue = Queue.new register_event_handler do |event| @event_queue << event end end |
Instance Attribute Details
#event_queue ⇒ Object
Returns the value of attribute event_queue.
4 5 6 |
# File 'lib/cucumber-voip/core_ext/punchblock/component/component_node.rb', line 4 def event_queue @event_queue end |
Instance Method Details
#next_event(timeout = nil) ⇒ Object
14 15 16 |
# File 'lib/cucumber-voip/core_ext/punchblock/component/component_node.rb', line 14 def next_event(timeout = nil) Timeout::timeout(timeout) { event_queue.pop } end |