Module: StrongRoutes

Defined in:
lib/strong_routes.rb,
lib/strong_routes/allow.rb,
lib/strong_routes/config.rb,
lib/strong_routes/matcher.rb,
lib/strong_routes/railtie.rb,
lib/strong_routes/version.rb,
lib/strong_routes/route_mapper.rb

Defined Under Namespace

Classes: Allow, Config, Matcher, Railtie, RouteMapper

Constant Summary collapse

VERSION =
"2.0.1"

Class Method Summary collapse

Class Method Details

.allowed?(route) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.allowed?(route)
  config.route_matchers.any? { |route_matcher| route_matcher =~ route }
end

.configObject



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

def self.config
  @config ||= Config.new
end

.responseObject



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

def self.response
  Rack::Response[config.status, config.headers, config.content]
end