Sha256: 2a1e64e291e29bda48069ecd78921bb1c04a171d1bf5849b85da813957b15b75

Contents?: true

Size: 367 Bytes

Versions: 12

Compression:

Stored size: 367 Bytes

Contents

class MockRedis
  class FutureNotReady < RuntimeError; end

  class Future
    attr_reader :command

    def initialize(command)
      @command = command
      @result_set = false
    end

    def value
      raise FutureNotReady unless @result_set
      @result
    end

    def store_result(result)
      @result_set = true
      @result = result
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mock_redis-0.18.0 lib/mock_redis/future.rb
mock_redis-0.17.3 lib/mock_redis/future.rb
mock_redis-0.17.2 lib/mock_redis/future.rb
mock_redis-0.17.1 lib/mock_redis/future.rb
mock_redis-0.17.0 lib/mock_redis/future.rb
mock_redis-0.16.1 lib/mock_redis/future.rb
mock_redis-0.16.0 lib/mock_redis/future.rb
mock_redis-0.15.4 lib/mock_redis/future.rb
mock_redis-0.15.3 lib/mock_redis/future.rb
mock_redis-0.15.2 lib/mock_redis/future.rb
mock_redis-0.15.1 lib/mock_redis/future.rb
mock_redis-0.15.0 lib/mock_redis/future.rb