Class: Rolify::Adapter::RoleAdapterBase

Inherits:
Base
  • Object
show all
Defined in:
lib/rolify/adapters/base.rb

Direct Known Subclasses

RoleAdapter

Instance Method Summary collapse

Methods inherited from Base

create, #initialize, #relation_types_for, #role_class, #role_table, #user_class

Constructor Details

This class inherits a constructor from Rolify::Adapter::Base

Instance Method Details

#add(relation, role_name, resource = nil) ⇒ Object

Raises:

  • (NotImplementedError)


41
42
43
# File 'lib/rolify/adapters/base.rb', line 41

def add(relation, role_name, resource = nil)
  raise NotImplementedError.new("You must implement add")
end

#exists?(relation, column) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


49
50
51
# File 'lib/rolify/adapters/base.rb', line 49

def exists?(relation, column)
  raise NotImplementedError.new("You must implement exists?")
end

#find_or_create_by(role_name, resource_type = nil, resource_id = nil) ⇒ Object

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/rolify/adapters/base.rb', line 37

def find_or_create_by(role_name, resource_type = nil, resource_id = nil)
  raise NotImplementedError.new("You must implement find_or_create_by")
end

#remove(relation, role_name, resource = nil) ⇒ Object

Raises:

  • (NotImplementedError)


45
46
47
# File 'lib/rolify/adapters/base.rb', line 45

def remove(relation, role_name, resource = nil)
  raise NotImplementedError.new("You must implement delete")
end

#where(relation, args) ⇒ Object

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/rolify/adapters/base.rb', line 33

def where(relation, args)
  raise NotImplementedError.new("You must implement where")
end