Sha256: 684110fbf1ae86fcc8536e5a262ee46d7a78c1f7bcf4d82515cc164960a5ba18

Contents?: true

Size: 346 Bytes

Versions: 73

Compression:

Stored size: 346 Bytes

Contents

class Lalala::Pages::PageTypeConstraint

  def initialize(type)
    unless Class === type
      type  = type.to_s.classify
      type += "Page" unless type.ends_with?("Page")
      type  = type.constantize
    end

    @type = type
  end

  def matches?(request)
    request.env['lalala.page'] and @type === request.env['lalala.page']
  end

end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
lalala-4.0.0.dev.189 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.188 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.187 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.186 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.185 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.184 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.183 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.181 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.180 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.179 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.178 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.177 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.176 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.170 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.168 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.165 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.162 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.161 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.160 lib/lalala/pages/page_type_constraint.rb
lalala-4.0.0.dev.157 lib/lalala/pages/page_type_constraint.rb