Sha256: 188379ea0986d0f222c90aeefc933d3100bc6a7f542f411b80f4d9719ffb7ef1

Contents?: true

Size: 338 Bytes

Versions: 3

Compression:

Stored size: 338 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

Version Path
active_mocker-1.5.2 lib/active_mocker/mock/hash_process.rb
active_mocker-1.5.1 lib/active_mocker/mock/hash_process.rb
active_mocker-1.5 lib/active_mocker/mock/hash_process.rb