Module: Canable::Actor::ClassMethods

Defined in:
lib/canable/actor.rb

Overview


RBAC Actor building DSL


Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#canable_default_roleObject

Returns the value of attribute canable_default_role.



57
58
59
# File 'lib/canable/actor.rb', line 57

def canable_default_role
  @canable_default_role
end

#canable_role_procObject

Returns the value of attribute canable_role_proc.



58
59
60
# File 'lib/canable/actor.rb', line 58

def canable_role_proc
  @canable_role_proc
end

Instance Method Details

#default_role(role) ⇒ Object



60
61
62
# File 'lib/canable/actor.rb', line 60

def default_role(role)
  self.canable_default_role = role
end

#role_attribute(attribute) ⇒ Object



64
65
66
67
68
# File 'lib/canable/actor.rb', line 64

def role_attribute(attribute)
  self.canable_role_proc = Proc.new {|actor|
    role = actor.instance_variable_get(attribute)
  }
end

#role_proc(proc) ⇒ Object



70
71
72
# File 'lib/canable/actor.rb', line 70

def role_proc(proc)
  self.canable_role_proc = proc
end