Class: Hash

Inherits:
Object show all
Defined in:
lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb,
lib/eac_ruby_utils/patches/hash/options_consumer.rb

Instance Method Summary collapse

Instance Method Details

#to_options_consumerObject

Returns an EacRubyUtils::OptionsConsumer out of its receiver.



7
8
9
# File 'lib/eac_ruby_utils/patches/hash/options_consumer.rb', line 7

def to_options_consumer
  ::EacRubyUtils::OptionsConsumer.new(self)
end

#to_sym_keys_hashObject



4
5
6
7
8
9
# File 'lib/eac_ruby_utils/patches/hash/sym_keys_hash.rb', line 4

def to_sym_keys_hash
  each_with_object({}) do |(key, value), memo|
    symbol_key = key.respond_to?(:to_sym) ? key.to_sym : key.to_s.to_sym
    memo[symbol_key] = value
  end
end