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.5.1"

Class Method Summary collapse

Class Method Details

.helpers(*extensions, &block) ⇒ Object

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



543
544
545
# File 'lib/mobb/base.rb', line 543

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.



531
532
533
534
535
# File 'lib/mobb/base.rb', line 531

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.



538
539
540
# File 'lib/mobb/base.rb', line 538

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

.use(*args, &block) ⇒ Object

Use the middleware for classic applications.



548
549
550
# File 'lib/mobb/base.rb', line 548

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