Sha256: 3116457b7277f7a9b6affd4d3eef47c24c375a505f4609085bb6eae1e51e187a

Contents?: true

Size: 434 Bytes

Versions: 31

Compression:

Stored size: 434 Bytes

Contents

# frozen_string_literal: true
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

31 entries across 31 versions & 1 rubygems

Version Path
active_mocker-2.6.2 lib/active_mocker/mock/hash_process.rb
active_mocker-2.6.1.beta2 lib/active_mocker/mock/hash_process.rb
active_mocker-2.6.1.beta lib/active_mocker/mock/hash_process.rb
active_mocker-2.6.0 lib/active_mocker/mock/hash_process.rb
active_mocker-2.5.4 lib/active_mocker/mock/hash_process.rb
active_mocker-2.5.3 lib/active_mocker/mock/hash_process.rb
active_mocker-2.5.2 lib/active_mocker/mock/hash_process.rb
active_mocker-2.5.1 lib/active_mocker/mock/hash_process.rb
active_mocker-2.5.1.pre lib/active_mocker/mock/hash_process.rb
active_mocker-2.5.0 lib/active_mocker/mock/hash_process.rb
active_mocker-2.4.4 lib/active_mocker/mock/hash_process.rb
active_mocker-2.4.3 lib/active_mocker/mock/hash_process.rb
active_mocker-2.4.2 lib/active_mocker/mock/hash_process.rb
active_mocker-2.4.1 lib/active_mocker/mock/hash_process.rb
active_mocker-2.4.0 lib/active_mocker/mock/hash_process.rb
active_mocker-2.4.0.pre5 lib/active_mocker/mock/hash_process.rb
active_mocker-2.3.4 lib/active_mocker/mock/hash_process.rb
active_mocker-2.4.0.pre4 lib/active_mocker/mock/hash_process.rb
active_mocker-2.4.0.pre3 lib/active_mocker/mock/hash_process.rb
active_mocker-2.4.0.pre2 lib/active_mocker/mock/hash_process.rb