Module: Masks::Adapter

Included in:
Masks::Adapters::ActiveRecord
Defined in:
app/models/concerns/masks/adapter.rb

Overview

An interface that all configuration adapters should adhere to.

Instance Method Summary collapse

Instance Method Details

#build_actor(session, **opts) ⇒ Masks::Actor

Builds an actor from the passed options, which may contain a nickname or email. Additional attributes, like a password, will not be supplied.

Parameters:

Returns:

Raises:

  • (NotImplementedError)


49
50
51
# File 'app/models/concerns/masks/adapter.rb', line 49

def build_actor(session, **opts)
  raise NotImplementedError
end

#expire_actorsObject

Expires any outdated or invalid actors.

Returns:

Raises:

  • (NotImplementedError)


38
39
40
# File 'app/models/concerns/masks/adapter.rb', line 38

def expire_actors
  raise NotImplementedError
end

#find_actor(session, **opts) ⇒ Masks::Actor

Returns an actor given the passed options, which may contain a nickname and/or an email.

Parameters:

Returns:

Raises:

  • (NotImplementedError)


22
23
24
# File 'app/models/concerns/masks/adapter.rb', line 22

def find_actor(session, **opts)
  raise NotImplementedError
end

#find_actors(session, actor_ids) ⇒ Array<Masks::Actor>

Returns a list of actors matching the passed actor_ids.

Parameters:

Returns:

Raises:

  • (NotImplementedError)


31
32
33
# File 'app/models/concerns/masks/adapter.rb', line 31

def find_actors(session, actor_ids)
  raise NotImplementedError
end

#initialize(config) ⇒ Masks::Adapter

Creates a new adapter.

Parameters:

Returns:



12
13
14
# File 'app/models/concerns/masks/adapter.rb', line 12

def initialize(config)
  @config = config
end