Module: Pendragon

Defined in:
lib/pendragon.rb,
lib/pendragon/error.rb,
lib/pendragon/route.rb,
lib/pendragon/router.rb,
lib/pendragon/matcher.rb,
lib/pendragon/padrino.rb,
lib/pendragon/version.rb,
lib/pendragon/configuration.rb,
lib/pendragon/padrino/route.rb,
lib/pendragon/padrino/router.rb,
lib/pendragon/engine/compiler.rb,
lib/pendragon/engine/recognizer.rb,
lib/pendragon/padrino/ext/class_methods.rb,
lib/pendragon/padrino/ext/instance_methods.rb

Defined Under Namespace

Modules: Padrino Classes: BadRequest, MethodNotAllowed, NotFound, ResponseError, Route, Router

Constant Summary collapse

HTTP_VERBS =

Allow the verbs of these.

%w[GET POST PUT PATCH DELETE HEAD OPTIONS LINK UNLINK].freeze
InvalidRouteException =

Raises the exception if routes that matches the condition do not exist

Class.new(ArgumentError)
VERSION =
'0.6.1'

Class Method Summary collapse

Class Method Details

.configurationObject

Deprecated.

Returns Pendragon configuration



30
31
32
33
# File 'lib/pendragon.rb', line 30

def configuration
  configuration_warning(:configuration)
  @configuration ||= Configuration.new
end

.configure(&block) ⇒ Object

Deprecated.

Yields Pendragon configuration block

Examples:

Pendragon.configure do |config|
  config.enable_compiler = true
end

See Also:

  • Configuration


22
23
24
25
26
# File 'lib/pendragon.rb', line 22

def configure(&block)
  configuration_warning(:configure)
  block.call(configuration) if block_given?
  configuration
end

.new(&block) ⇒ Object

A new instance of Pendragon::Router



11
12
13
# File 'lib/pendragon.rb', line 11

def new(&block)
  Router.new(&block)
end

.reset_configuration!Object

Deprecated.

Resets Pendragon configuration



37
38
39
# File 'lib/pendragon.rb', line 37

def reset_configuration!
  @configuration = nil
end