Sha256: 2f4b1f383aa4e21b088361ec02ebd78c62d7039a2a4deb65f9ac72856fd77677
Contents?: true
Size: 482 Bytes
Versions: 2
Compression:
Stored size: 482 Bytes
Contents
module Seory module Condition class Slug def self.supposable?(condition_object) controller, action = condition_object.to_s.split('#') controller && action end def initialize(slug) @slug = slug end def match?(controller) action_slug(controller) == @slug end private def action_slug(controller) [controller.controller_path, controller.action_name].join('#') end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
seory-0.2.0 | lib/seory/condition/slug.rb |
seory-0.1.0 | lib/seory/condition/slug.rb |