Class: Grape::Idempotency::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/grape/idempotency.rb

Defined Under Namespace

Classes: Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



218
219
220
221
222
223
224
225
226
# File 'lib/grape/idempotency.rb', line 218

def initialize
  @storage = nil
  @expires_in = 216_000
  @idempotency_key_header = "idempotency-key"
  @request_id_header = "x-request-id"
  @conflict_error_response = { 
    "error" => "You are using the same idempotent key for two different requests"
  }
end

Instance Attribute Details

#conflict_error_responseObject

Returns the value of attribute conflict_error_response.



214
215
216
# File 'lib/grape/idempotency.rb', line 214

def conflict_error_response
  @conflict_error_response
end

#expires_inObject

Returns the value of attribute expires_in.



214
215
216
# File 'lib/grape/idempotency.rb', line 214

def expires_in
  @expires_in
end

#idempotency_key_headerObject

Returns the value of attribute idempotency_key_header.



214
215
216
# File 'lib/grape/idempotency.rb', line 214

def idempotency_key_header
  @idempotency_key_header
end

#request_id_headerObject

Returns the value of attribute request_id_header.



214
215
216
# File 'lib/grape/idempotency.rb', line 214

def request_id_header
  @request_id_header
end

#storageObject

Returns the value of attribute storage.



214
215
216
# File 'lib/grape/idempotency.rb', line 214

def storage
  @storage
end