123456789_123456789_123456789_123456789_123456789_

Class: Redis::Future

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: BasicObject
Defined in: lib/redis/pipeline.rb

Constant Summary

Class Method Summary

Instance Method Summary

Constructor Details

.new(command, coerce, exception) ⇒ Future

[ GitHub ]

  
# File 'lib/redis/pipeline.rb', line 83

def initialize(command, coerce, exception)
  @command = command
  @object = FutureNotReady
  @coerce = coerce
  @exception = exception
end

Instance Method Details

#_set(object)

[ GitHub ]

  
# File 'lib/redis/pipeline.rb', line 94

def _set(object)
  @object = @coerce ? @coerce.call(object) : object
  value
end

#class

[ GitHub ]

  
# File 'lib/redis/pipeline.rb', line 108

def class
  Future
end

#inspect

[ GitHub ]

  
# File 'lib/redis/pipeline.rb', line 90

def inspect
  "<Redis::Future #{@command.inspect}>"
end

#is_a?(other) ⇒ Boolean

[ GitHub ]

  
# File 'lib/redis/pipeline.rb', line 104

def is_a?(other)
  self.class.ancestors.include?(other)
end

#value

[ GitHub ]

  
# File 'lib/redis/pipeline.rb', line 99

def value
  ::Kernel.raise(@object) if @exception && @object.is_a?(::StandardError)
  @object
end