Class: Omie::Middleware::Authentication
- Inherits:
-
Object
- Object
- Omie::Middleware::Authentication
- Defined in:
- lib/omie/middleware/authentication.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#app_key ⇒ Object
readonly
Returns the value of attribute app_key.
-
#app_secret ⇒ Object
readonly
Returns the value of attribute app_secret.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Authentication
constructor
A new instance of Authentication.
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, = {}) @app = app @app_key = .fetch(:app_key) @app_secret = .fetch(:app_secret) end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/omie/middleware/authentication.rb', line 6 def app @app end |
#app_key ⇒ Object (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_secret ⇒ Object (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 |