Module: RoleModel

Includes:
Implementation
Defined in:
lib/role_model.rb,
lib/role_model/roles.rb,
lib/role_model/class_methods.rb,
lib/role_model/implementation.rb

Defined Under Namespace

Modules: ClassMethods, Implementation Classes: Roles

Constant Summary collapse

INHERITABLE_CLASS_ATTRIBUTES =
[:roles_attribute_name, :valid_roles]

Class Method Summary collapse

Methods included from Implementation

#has_all_roles?, #has_any_role?, #has_only_roles?, #role_symbols, #roles, #roles=

Class Method Details

.included(base) ⇒ Object

:nodoc:



11
12
13
14
15
16
17
18
19
20
# File 'lib/role_model.rb', line 11

def self.included(base) # :nodoc:
  base.extend ClassMethods
  base.class_eval do
    class << self
      attr_accessor(*::RoleModel::INHERITABLE_CLASS_ATTRIBUTES)
    end
    roles_attribute :roles_mask # set default bitmask attribute
    self.valid_roles = []
  end
end