Class: Cubic::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/cubic/engine.rb

Overview

Engine is what makes Cubic a Rack application.

Direct Known Subclasses

Application

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Engine

Returns a new instance of Engine.



12
13
14
# File 'lib/cubic/engine.rb', line 12

def initialize(env)
  @request = Rack::Request.new(env)
end

Class Method Details

.call(env) ⇒ Object



8
9
10
# File 'lib/cubic/engine.rb', line 8

def self.call(env)
  new(env).response.finish
end

Instance Method Details

#responseObject



16
17
18
19
20
21
22
23
# File 'lib/cubic/engine.rb', line 16

def response
  Application.load_app
  if search_routes
    Response.new render
  else
    Response.new(status_404)
  end
end