Module: Cuba

Defined in:
lib/cuba.rb,
lib/cuba/ron.rb,
lib/cuba/version.rb

Defined Under Namespace

Classes: Ron

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.appObject



10
11
12
# File 'lib/cuba.rb', line 10

def self.app
  @app ||= Rack::Builder.new
end

.call(env) ⇒ Object



26
27
28
# File 'lib/cuba.rb', line 26

def self.call(env)
  prototype.call(env)
end

.define(&block) ⇒ Object



18
19
20
# File 'lib/cuba.rb', line 18

def self.define(&block)
  app.run Cuba::Ron.new(&block)
end

.prototypeObject



22
23
24
# File 'lib/cuba.rb', line 22

def self.prototype
  @prototype ||= app.to_app
end

.reset!Object



5
6
7
8
# File 'lib/cuba.rb', line 5

def self.reset!
  @app = nil
  @prototype = nil
end

.use(middleware, *args, &block) ⇒ Object



14
15
16
# File 'lib/cuba.rb', line 14

def self.use(middleware, *args, &block)
  app.use(middleware, *args, &block)
end