lib/nrser/rspex.rb
# Merge "expectation" hashes by appending all clauses for each state.
# 
# @param [Array<Hash>] expectations
#   Splat of "expectation" hashes - see the examples.
# 
Merge "expectation" hashes by appending all clauses for each state.
Merge " expectation " hashes by appending all clauses for each state .
def merge_expectations *expectations
  Hash.new { |result, state|
    result[state] = []
  }.tap { |result|
    expectations.each { |ex|
      ex.each { |state, clauses|
        result[state] += clauses.to_a
      }
    }
  }
end
def merge_expectations * expectations Hash . new { | result , state | result [ state ] = [ ] } . tap { | result | expectations . each { | ex | ex . each { | state , clauses | result [ state ] += clauses . to_a } } } end
Merge "expectation" hashes by appending all clauses for each state.
Merge " expectation " hashes by appending all clauses for each state .
expectations
<not_specific>
<not_specific>
expectations Splat of "expectation" hashes - see the examples.
expectations Splat of " expectation " hashes - see the examples .