Class: FlyingSphinx::Request::HMAC

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/flying_sphinx/request/hmac.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, identifier, api_key, service) ⇒ HMAC

Returns a new instance of HMAC.



2
3
4
5
6
7
8
# File 'lib/flying_sphinx/request/hmac.rb', line 2

def initialize(app, identifier, api_key, service)
  super app

  @identifier = identifier
  @api_key    = api_key
  @service    = service
end

Instance Method Details

#call(environment) ⇒ Object



10
11
12
13
14
15
# File 'lib/flying_sphinx/request/hmac.rb', line 10

def call(environment)
  Ey::Hmac.sign! environment, identifier, api_key,
    :adapter => Ey::Hmac::Adapter::Faraday, :service => service

  app.call environment
end