module Authority::Abilities::ClassMethods

Public Instance Methods

authorizer() click to toggle source

@return [Class] of the designated authorizer

# File lib/authority/abilities.rb, line 50
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
authorizer=(authorizer_class) click to toggle source
# File lib/authority/abilities.rb, line 44
def authorizer=(authorizer_class)
  @authorizer          = authorizer_class
  self.authorizer_name = @authorizer.name
end