Module: HttpStub::Extensions::Core::Hash

Defined in:
lib/http_stub/extensions/core/hash.rb,
lib/http_stub/extensions/core/hash/formatted.rb,
lib/http_stub/extensions/core/hash/indifferent_and_insensitive_access.rb,
lib/http_stub/extensions/core/hash/with_indifferent_and_insensitive_access.rb

Defined Under Namespace

Modules: Formatted, IndifferentAndInsensitiveAccess Classes: WithIndifferentAndInsensitiveAccess

Instance Method Summary collapse

Instance Method Details

#underscore_keysObject


7
8
9
10
11
# File 'lib/http_stub/extensions/core/hash.rb', line 7

def underscore_keys
  self.each_with_object({}) do |element, result|
    result[element[0].is_a?(::String) ? element[0].tr("-", "_") : element[0]] = element[1]
  end
end

#with_indifferent_and_insensitive_accessObject


13
14
15
# File 'lib/http_stub/extensions/core/hash.rb', line 13

def with_indifferent_and_insensitive_access
  HttpStub::Extensions::Core::Hash::WithIndifferentAndInsensitiveAccess.new(self)
end