Class: Omie::Middleware::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/omie/middleware/authentication.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ Authentication

Returns a new instance of Authentication.



8
9
10
11
12
# File 'lib/omie/middleware/authentication.rb', line 8

def initialize(app, options = {})
  @app = app
  @app_key = options.fetch(:app_key)
  @app_secret = options.fetch(:app_secret)
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



6
7
8
# File 'lib/omie/middleware/authentication.rb', line 6

def app
  @app
end

#app_keyObject (readonly)

Returns the value of attribute app_key.



6
7
8
# File 'lib/omie/middleware/authentication.rb', line 6

def app_key
  @app_key
end

#app_secretObject (readonly)

Returns the value of attribute app_secret.



6
7
8
# File 'lib/omie/middleware/authentication.rb', line 6

def app_secret
  @app_secret
end

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
# File 'lib/omie/middleware/authentication.rb', line 14

def call(env)
  env[:body] = body_with_authentication(env[:body])

  app.call(env)
end