class NRB::BreweryControlSystem::HTTPService::UserAgent

Constants

NAME
URL

Public Class Methods

new(app) click to toggle source
# File lib/brewery_control_system/http_service/user_agent.rb, line 19
def initialize(app)
  @app = app
end

Public Instance Methods

agent() click to toggle source
# File lib/brewery_control_system/http_service/user_agent.rb, line 8
def agent
  @agent ||= "#{name} #{version} (#{url})".freeze
end
call(env) click to toggle source
# File lib/brewery_control_system/http_service/user_agent.rb, line 13
def call(env)
  env[:request_headers]["User-Agent"] = agent
  @app.call(env).on_complete { }
end
name() click to toggle source
# File lib/brewery_control_system/http_service/user_agent.rb, line 24
def name; NAME; end
url() click to toggle source
# File lib/brewery_control_system/http_service/user_agent.rb, line 27
def url; URL; end
version() click to toggle source
# File lib/brewery_control_system/http_service/user_agent.rb, line 30
def version; NRB::BreweryControlSystem.version; end