Class: Couchbase::Protostellar::RequestBehaviour Private

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/protostellar/request_behaviour.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(retry_duration: nil, error: nil) ⇒ RequestBehaviour

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of RequestBehaviour.



24
25
26
27
# File 'lib/couchbase/protostellar/request_behaviour.rb', line 24

def initialize(retry_duration: nil, error: nil)
  @retry_duration = retry_duration
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
# File 'lib/couchbase/protostellar/request_behaviour.rb', line 22

def error
  @error
end

#retry_durationObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



21
22
23
# File 'lib/couchbase/protostellar/request_behaviour.rb', line 21

def retry_duration
  @retry_duration
end

Class Method Details

.fail(error) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
# File 'lib/couchbase/protostellar/request_behaviour.rb', line 29

def self.fail(error)
  RequestBehaviour.new(error: error)
end

.retry(retry_duration) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
# File 'lib/couchbase/protostellar/request_behaviour.rb', line 33

def self.retry(retry_duration)
  RequestBehaviour.new(retry_duration: retry_duration)
end

.successObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
# File 'lib/couchbase/protostellar/request_behaviour.rb', line 37

def self.success
  RequestBehaviour.new(retry_duration: nil, error: nil)
end