85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
# File 'lib/statesmin/machine.rb', line 85
def validate_callback_condition(options = { from: nil, to: nil })
from = to_s_or_nil(options[:from])
to = array_to_s_or_nil(options[:to])
([from] + to).compact.each { |state| validate_state(state) }
return if from.nil? && to.empty?
validate_not_from_terminal_state(from)
to.each { |state| validate_not_to_initial_state(state) }
return if from.nil? || to.empty?
to.each { |state| validate_from_and_to_state(from, state) }
end
|