Sha256: eab73408a7bf613b0ee57484a680cce2b6edc227c60a84676b71ebb1b218cacc

Contents?: true

Size: 404 Bytes

Versions: 7

Compression:

Stored size: 404 Bytes

Contents

module ActiveMocker
  # @api private
  class HashProcess

    attr_accessor :hash, :processor

    def initialize(hash, processor)
      @hash         = hash
      @processor    = processor
      @hash_process = {}
    end

    def [](val)
      @hash_process[val] ||= processor.call(hash[val])
    end

    def merge(merge_hash)
      self.hash = hash.merge(merge_hash.hash)
      self
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_mocker-2.1.3 lib/active_mocker/mock/hash_process.rb
active_mocker-2.1.2 lib/active_mocker/mock/hash_process.rb
active_mocker-2.1.1 lib/active_mocker/mock/hash_process.rb
active_mocker-2.1.0 lib/active_mocker/mock/hash_process.rb
active_mocker-2.0.0 lib/active_mocker/mock/hash_process.rb
active_mocker-2.0.0.rc1 lib/active_mocker/mock/hash_process.rb
active_mocker-2.0.0.pre1 lib/active_mocker/mock/hash_process.rb