Sha256: 54374339cc6ce3ff7c3f8020496f26342d461b6f3441bdce5f994a98d52b3b15

Contents?: true

Size: 357 Bytes

Versions: 5

Compression:

Stored size: 357 Bytes

Contents

module ActiveMocker
  module Mock
    # @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

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
active_mocker-1.6.4 lib/active_mocker/mock/hash_process.rb
active_mocker-1.6.3 lib/active_mocker/mock/hash_process.rb
active_mocker-1.6.2 lib/active_mocker/mock/hash_process.rb
active_mocker-1.6.1 lib/active_mocker/mock/hash_process.rb
active_mocker-1.6 lib/active_mocker/mock/hash_process.rb