Module: Roles::Generic::Role::ClassMethods

Defined in:
lib/roles_generic/generic/role.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#class_constantObject

Returns the value of attribute class_constant.



9
10
11
# File 'lib/roles_generic/generic/role.rb', line 9

def class_constant
  @class_constant
end

Instance Method Details

#role_class(class_constant) ⇒ Object



20
21
22
# File 'lib/roles_generic/generic/role.rb', line 20

def role_class class_constant
  @class_constant = class_constant  
end

#role_class_nameObject



11
12
13
14
15
16
17
18
# File 'lib/roles_generic/generic/role.rb', line 11

def role_class_name
  const = class_constant.to_s.camelize
  begin
    @role_class_name ||= "#{const}".constantize
  rescue
    puts "Role class constant '#{const}' is not defined so it could not be set!"
  end
end