Module: FSM::Options::InstanceMethods
- Included in:
- State, Transition
- Defined in:
- lib/fsm/options.rb
Instance Method Summary collapse
Instance Method Details
#assert_options(options, optional_keys = {}, mandatory_keys = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/fsm/options.rb', line 4 def (, optional_keys = {}, mandatory_keys = {}) keys_processed = [] mandatory_keys.each do |key| raise ArgumentError.new("Mandatory Key #{key} is missing") unless .keys.include?(key) keys_processed << key end .keys.each do |key| raise ArgumentError.new("Unsupported key #{key}") unless optional_keys.include?(key) || mandatory_keys.include?(key) end end |