class Rack::GeoIPCountry::Mapping
Public Class Methods
new(app, options = {})
click to toggle source
# File lib/rack/geoipcountry.rb, line 48 def initialize(app, options = {}) @app, @prefix = app, /^#{options.delete(:prefix)}/ @geoip_country = GeoIPCountry.new(app, options) end
Public Instance Methods
call(env)
click to toggle source
# File lib/rack/geoipcountry.rb, line 53 def call(env) if env['PATH_INFO'] =~ @prefix @geoip_country.call(env) else @app.call(env) end end