Sha256: 71db2456740ca83a03ea78e40e5e6bc7a784660e5dc633ac7155559197d5a28a
Contents?: true
Size: 384 Bytes
Versions: 1
Compression:
Stored size: 384 Bytes
Contents
module Matchd module Helpers module_function # 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. def extract_options(keys, options) keys.each_with_object({}) do |key, o| o[key.to_sym] = options[key] if options.key?(key) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
matchd-0.1.0 | lib/matchd/helpers.rb |