Class: Sbire::StreamManager
- Inherits:
-
Object
- Object
- Sbire::StreamManager
- Defined in:
- lib/sbire/stream_manager.rb
Instance Attribute Summary collapse
-
#last_index ⇒ Object
Returns the value of attribute last_index.
-
#max_index ⇒ Object
Returns the value of attribute max_index.
Instance Method Summary collapse
- #execute(hypotheses, index, &block) ⇒ Object
-
#initialize ⇒ StreamManager
constructor
A new instance of StreamManager.
Constructor Details
#initialize ⇒ StreamManager
Returns a new instance of StreamManager.
5 6 7 8 |
# File 'lib/sbire/stream_manager.rb', line 5 def initialize @last_index = 0 @max_index = 0 end |
Instance Attribute Details
#last_index ⇒ Object
Returns the value of attribute last_index.
3 4 5 |
# File 'lib/sbire/stream_manager.rb', line 3 def last_index @last_index end |
#max_index ⇒ Object
Returns the value of attribute max_index.
3 4 5 |
# File 'lib/sbire/stream_manager.rb', line 3 def max_index @max_index end |
Instance Method Details
#execute(hypotheses, index, &block) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/sbire/stream_manager.rb', line 10 def execute(hypotheses, index, &block) compute_max_index(index) hypotheses = current_hypotheses(hypotheses) unless hypotheses.include?(nil) send_result(hypotheses, block) @last_index = index + 1 end end |