Sha256: 1989dd8f5fa0a441efe519f20b175d8d55ddd3b2735f752cb2f686f3773f3036

Contents?: true

Size: 431 Bytes

Versions: 2

Compression:

Stored size: 431 Bytes

Contents

require 'active_support/inflector'

module CanTango
  class PermitEngine < Engine
    module Util
      def permit_name clazz
        @name ||= clazz.to_s.demodulize.gsub(/Role/,'').gsub(/Permit$/, '').gsub(/Group/,'').underscore.to_sym
      end
      
      # TODO:
      def role
        @role ||= permit_name
      end

      def localhost_manager?
        Permits::Configuration.localhost_manager
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cantango-0.8.9.5 lib/cantango/permit_engine/util.rb
cantango-0.8.9.4 lib/cantango/permit_engine/util.rb