Module: Mobb

Defined in:
lib/mobb/base.rb,
lib/mobb/main.rb,
lib/mobb/version.rb

Defined Under Namespace

Modules: Delegator Classes: Application, Base, Matcher

Constant Summary collapse

VERSION =
"0.4.0"

Class Method Summary collapse

Class Method Details

.helpers(*extensions, &block) ⇒ Object

Include the helper modules provided in Mobb’s request context.



494
495
496
# File 'lib/mobb/base.rb', line 494

def self.helpers(*extensions, &block)
  Delegator.target.helpers(*extensions, &block)
end

.new(base = Base, &block) ⇒ Object

Create a new Mobb application; the block is evaluated in the class scope.



482
483
484
485
486
# File 'lib/mobb/base.rb', line 482

def self.new(base = Base, &block)
  base = Class.new(base)
  base.class_eval(&block) if block_given?
  base
end

.register(*extensions, &block) ⇒ Object

Extend the top-level DSL with the modules provided.



489
490
491
# File 'lib/mobb/base.rb', line 489

def self.register(*extensions, &block)
  Delegator.target.register(*extensions, &block)
end

.use(*args, &block) ⇒ Object

Use the middleware for classic applications.



499
500
501
# File 'lib/mobb/base.rb', line 499

def self.use(*args, &block)
  Delegator.target.use(*args, &block)
end