Class: Rack::BetaSite
- Inherits:
-
Object
- Object
- Rack::BetaSite
- Includes:
- Utils
- Defined in:
- lib/bacchus/rack/beta_site.rb
Defined Under Namespace
Classes: Request
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ BetaSite
constructor
A new instance of BetaSite.
Constructor Details
#initialize(app, options = {}) ⇒ BetaSite
Returns a new instance of BetaSite.
19 20 21 22 23 24 25 26 |
# File 'lib/bacchus/rack/beta_site.rb', line 19 def initialize(app, = {}) @app = app @excluded_routes = [:except] || [] @access_form_routes = [:access_through] || [] @access_template_route = [:access_template] or raise "Specify the route to the template for the access form." base_url = [:backend] or raise "Specify the address of the backend server." @backend = Bacchus::Backend.new(base_url) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
17 18 19 |
# File 'lib/bacchus/rack/beta_site.rb', line 17 def @options end |
Instance Method Details
#call(env) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/bacchus/rack/beta_site.rb', line 28 def call(env) request = Request.new(env) access_pass = Bacchus::AccessPass.get(request) status, headers, body = respond_to(request, access_pass) response = Response.new(body, status, headers) access_pass.maybe_save(response) response.finish end |