Module: Matchd::Helpers
- Defined in:
- lib/matchd/helpers.rb
Class Method Summary collapse
-
.extract_options(keys, options) ⇒ Object
Creates a new Hash with the key-value pairs of options for the keys given and only if options has that keys.
Class Method Details
.extract_options(keys, options) ⇒ Object
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.
8 9 10 11 12 |
# File 'lib/matchd/helpers.rb', line 8 def (keys, ) keys.each_with_object({}) do |key, o| o[key.to_sym] = [key] if .key?(key) end end |