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

- (Boolean) completed?



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

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

- (Object) data



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

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

- (Object) error



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

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

- (Boolean) failed?



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

def failed?
  status == :failed
end

- (Object) status



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

def status
  @deferred_status
end

- (Boolean) succeeded?



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

def succeeded?
  status == :succeeded
end