class StateMachineChecker::CheckResult
The results of checking whether a given model satisfies a given formula.
Attributes
result_hash[R]
Public Class Methods
new(result_hash)
click to toggle source
@param [Hash<Symbol, StateResult>] result_hash
# File lib/state_machine_checker/check_result.rb, line 5 def initialize(result_hash) @result_hash = result_hash end
Public Instance Methods
for_state(state)
click to toggle source
The result for a particular state.
@param [Symbol] state @return [StateResult]
# File lib/state_machine_checker/check_result.rb, line 13 def for_state(state) result_hash[state] end
intersection(other)
click to toggle source
# File lib/state_machine_checker/check_result.rb, line 25 def intersection(other) map { |state, result| result.and(other.for_state(state)) } end
map(&block)
click to toggle source
# File lib/state_machine_checker/check_result.rb, line 29 def map(&block) entries = result_hash.map { |state, result| [state, block.yield(state, result)] } CheckResult.new(Hash[entries]) end
to_h()
click to toggle source
# File lib/state_machine_checker/check_result.rb, line 17 def to_h result_hash.clone end
union(other)
click to toggle source
# File lib/state_machine_checker/check_result.rb, line 21 def union(other) map { |state, result| result.or(other.for_state(state)) } end