Sha256: d135a682b6b89f5af4cfd31d32ea9f5e4e928323c751056de972bb5abe878afe

Contents?: true

Size: 265 Bytes

Versions: 15

Compression:

Stored size: 265 Bytes

Contents

module Sitepress
  # Route constraint for rails routes.rb file.
  class RouteConstraint
    attr_reader :site

    def initialize(site: Sitepress.site)
      @site = site
    end

    def matches?(request)
      !!site.resources.get(request.path)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sitepress-rails-4.0.5 lib/sitepress/route_constraint.rb
sitepress-rails-4.0.4 lib/sitepress/route_constraint.rb
sitepress-rails-4.0.3 lib/sitepress/route_constraint.rb
sitepress-rails-4.0.2 lib/sitepress/route_constraint.rb
sitepress-rails-4.0.1 lib/sitepress/route_constraint.rb
sitepress-rails-4.0.0 lib/sitepress/route_constraint.rb
sitepress-rails-4.0.0.beta1 lib/sitepress/route_constraint.rb
sitepress-rails-3.2.2 lib/sitepress/route_constraint.rb
sitepress-rails-3.2.1 lib/sitepress/route_constraint.rb
sitepress-rails-3.2.0 lib/sitepress/route_constraint.rb
sitepress-rails-3.1.4 lib/sitepress/route_constraint.rb
sitepress-rails-3.1.3 lib/sitepress/route_constraint.rb
sitepress-rails-3.1.2 lib/sitepress/route_constraint.rb
sitepress-rails-3.1.1 lib/sitepress/route_constraint.rb
sitepress-rails-3.0.1 lib/sitepress/route_constraint.rb