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.



140
141
142
143
144
145
146
147
148
# File 'lib/grape/idempotency.rb', line 140

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.



136
137
138
# File 'lib/grape/idempotency.rb', line 136

def conflict_error_response
  @conflict_error_response
end

#expires_inObject

Returns the value of attribute expires_in.



136
137
138
# File 'lib/grape/idempotency.rb', line 136

def expires_in
  @expires_in
end

#idempotency_key_headerObject

Returns the value of attribute idempotency_key_header.



136
137
138
# File 'lib/grape/idempotency.rb', line 136

def idempotency_key_header
  @idempotency_key_header
end

#request_id_headerObject

Returns the value of attribute request_id_header.



136
137
138
# File 'lib/grape/idempotency.rb', line 136

def request_id_header
  @request_id_header
end

#storageObject

Returns the value of attribute storage.



136
137
138
# File 'lib/grape/idempotency.rb', line 136

def storage
  @storage
end