4 def initialize error_generator
5 @error_generator = error_generator
9 def register(expectation)
10 @ordering << expectation
13 def ready_for?(expectation)
14 return @ordering.first == expectation
21 def handle_order_constraint expectation
22 return unless @ordering.include? expectation
23 return consume if ready_for?(expectation)
24 @error_generator.raise_out_of_order_error expectation.sym