Sha256: d0b9c0845059f02d104161751c9a7107df7647dfa734346936269351f88092cf

Contents?: true

Size: 551 Bytes

Versions: 8

Compression:

Stored size: 551 Bytes

Contents

module Cream::View
  module Role    
    # admin?,  guest? ...
    Cream::Role.available.each do |role|
      class_eval %{
        def #{role}_area &block
          area_for_roles(#{role}, &block)
        end 
        
        def for_#{role}(&block)
          for_roles(#{role}, &block)          
        end
      }
    end
  end
end

module Cream::Helper
  module Role    
    # admin?,  guest? ...
    Cream::Role.available.each do |role|
      class_eval %{
        def #{role}?
          has_role? :#{role}
        end
      }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cream-0.7.0 lib/cream/configure/after_init/role_config.rb
cream-0.6.4 lib/cream/configure/after_init/role_config.rb
cream-0.6.3 lib/cream/configure/after_init/role_config.rb
cream-0.6.1 lib/cream/configure/after_init/role_config.rb
cream-0.6.0 lib/cream/configure/after_init/role_config.rb
cream-0.5.10 lib/cream/configure/after_init/role_config.rb
cream-0.5.9 lib/cream/configure/after_init/role_config.rb
cream-0.5.8 lib/cream/configure/after_init/role_config.rb