Module: Authority::Abilities::ClassMethods

Extended by:
Forwardable
Defined in:
lib/authority/abilities.rb

Instance Method Summary collapse

Instance Method Details

#authorizerClass

Returns of the designated authorizer.

Returns:

  • (Class)

    of the designated authorizer



45
46
47
48
49
50
51
# File 'lib/authority/abilities.rb', line 45

def authorizer
  @authorizer ||= authorizer_name.constantize # Get an actual reference to the authorizer class
rescue NameError
  raise Authority::NoAuthorizerError.new(
    "#{authorizer_name} is set as the authorizer for #{self}, but the constant is missing"
  )
end