Sha256: b55a2bf75d18edd2f24b008f4193eb5334fa9ea86895dc4b38af2acc9e541a16
Contents?: true
Size: 544 Bytes
Versions: 10
Compression:
Stored size: 544 Bytes
Contents
module FSM module Options module InstanceMethods def assert_options(options, optional_keys = {}, mandatory_keys = {}) keys_processed = [] mandatory_keys.each do |key| raise ArgumentError.new("Mandatory Key #{key} is missing") unless options.keys.include?(key) keys_processed << key end options.keys.each do |key| raise ArgumentError.new("Unsupported key #{key}") unless optional_keys.include?(key) || mandatory_keys.include?(key) end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems