Module: Pact::SymbolizeKeys
- Included in:
- ArrayLike, ConsumerContract, HttpConsumerContractParser, InteractionV2Parser, InteractionV3Parser, QueryHash, Request::Base, Response, ServiceConsumer, ServiceProvider, SomethingLike
- Defined in:
- lib/pact/symbolize_keys.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/pact/symbolize_keys.rb', line 4 def self.included(base) base.extend(self) end |
Instance Method Details
#symbolize_keys(hash) ⇒ Object
8 9 10 11 |
# File 'lib/pact/symbolize_keys.rb', line 8 def symbolize_keys hash return nil if hash.nil? hash.inject({}) { |memo, (k,v)| memo[k.to_sym] = v; memo } end |