Class: SSDB::Future

Inherits:
BasicObject
Defined in:
lib/ssdb/future.rb

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Future

Returns a new instance of Future.


3
4
5
# File 'lib/ssdb/future.rb', line 3

def initialize(command)
  @command = command
end

Instance Method Details

#classObject


26
27
28
# File 'lib/ssdb/future.rb', line 26

def class
  ::SSDB::Future
end

#inspectObject


7
8
9
# File 'lib/ssdb/future.rb', line 7

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

#instance_of?(klass) ⇒ Boolean

Returns:

  • (Boolean)

22
23
24
# File 'lib/ssdb/future.rb', line 22

def instance_of?(klass)
  klass == ::SSDB::Future
end

#valueObject


15
16
17
18
19
20
# File 'lib/ssdb/future.rb', line 15

def value
  unless defined?(@value)
    ::Kernel.raise ::SSDB::FutureNotReady, "Value of #{@command.inspect} is not ready"
  end
  @value
end

#value=(value) ⇒ Object


11
12
13
# File 'lib/ssdb/future.rb', line 11

def value=(value)
  @value = value
end