class EnotasNfe::Middleware

Public Class Methods

new(app, auth_token = nil) click to toggle source
# File lib/enotas_nfe/middleware.rb, line 11
def initialize(app, auth_token = nil)
  @app = app
  @auth_token = auth_token
end

Public Instance Methods

call(env) click to toggle source
# File lib/enotas_nfe/middleware.rb, line 4
def call(env)      
  if @auth_token
    env[:request_headers] = env[:request_headers].merge("Authorization": "Basic #{@auth_token}")
  end
  @app.call env
end