Class: Redis::Future
- Inherits:
- BasicObject
- Defined in:
- lib/redis/pipeline.rb
Constant Summary collapse
- FutureNotReady =
::Redis::FutureNotReady.new
Instance Attribute Summary collapse
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
- #_command ⇒ Object
- #_set(object) ⇒ Object
- #class ⇒ Object
-
#initialize(command, transformation, timeout) ⇒ Future
constructor
A new instance of Future.
- #inspect ⇒ Object
- #is_a?(other) ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(command, transformation, timeout) ⇒ Future
Returns a new instance of Future.
135 136 137 138 139 140 |
# File 'lib/redis/pipeline.rb', line 135 def initialize(command, transformation, timeout) @command = command @transformation = transformation @timeout = timeout @object = FutureNotReady end |
Instance Attribute Details
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
133 134 135 |
# File 'lib/redis/pipeline.rb', line 133 def timeout @timeout end |
Instance Method Details
#_command ⇒ Object
151 152 153 |
# File 'lib/redis/pipeline.rb', line 151 def _command @command end |
#_set(object) ⇒ Object
146 147 148 149 |
# File 'lib/redis/pipeline.rb', line 146 def _set(object) @object = @transformation ? @transformation.call(object) : object value end |
#class ⇒ Object
164 165 166 |
# File 'lib/redis/pipeline.rb', line 164 def class Future end |
#inspect ⇒ Object
142 143 144 |
# File 'lib/redis/pipeline.rb', line 142 def inspect "<Redis::Future #{@command.inspect}>" end |
#is_a?(other) ⇒ Boolean
160 161 162 |
# File 'lib/redis/pipeline.rb', line 160 def is_a?(other) self.class.ancestors.include?(other) end |
#value ⇒ Object
155 156 157 158 |
# File 'lib/redis/pipeline.rb', line 155 def value ::Kernel.raise(@object) if @object.kind_of?(::RuntimeError) @object end |