Class: Sbire::StreamManager

Inherits:
Object
  • Object
show all
Defined in:
lib/sbire/stream_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStreamManager

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_indexObject

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_indexObject

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