Class: EM::Mongo::RequestResponse

Inherits:
Object
  • Object
show all
Includes:
Deferrable
Defined in:
lib/em-mongo/request_response.rb

Instance Method Summary collapse

Instance Method Details

#completed?Boolean



10
11
12
# File 'lib/em-mongo/request_response.rb', line 10

def completed?
  [:succeeded, :failed].include?(status)
end

#dataObject



22
23
24
# File 'lib/em-mongo/request_response.rb', line 22

def data
  @deferred_args[-1] if succeeded? && @deferred_args
end

#errorObject



26
27
28
# File 'lib/em-mongo/request_response.rb', line 26

def error
  @deferred_args[-1] if failed? && @deferred_args
end

#failed?Boolean



18
19
20
# File 'lib/em-mongo/request_response.rb', line 18

def failed?
  status == :failed
end

#statusObject



6
7
8
# File 'lib/em-mongo/request_response.rb', line 6

def status
  @deferred_status
end

#succeeded?Boolean



14
15
16
# File 'lib/em-mongo/request_response.rb', line 14

def succeeded?
  status == :succeeded
end