module Matchd::Helpers
Public Instance Methods
extract_options(keys, options)
click to toggle source
Creates a new Hash with the key-value pairs of options for the keys given and only if options has that keys. Also, new keys will get symbolized.
# File lib/matchd/helpers.rb, line 8 def extract_options(keys, options) keys.each_with_object({}) do |key, o| o[key.to_sym] = options[key] if options.key?(key) end end