Class: Ddr::Auth::AbilityDefinitions Abstract

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/ddr/auth/ability_definitions.rb

Overview

This class is abstract.

A class which applies ability definitions to the delegated ability class when ‘#call` is invoked.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(ability) ⇒ Object

Applies ability definitions to the ability and return it



14
15
16
17
# File 'lib/ddr/auth/ability_definitions.rb', line 14

def self.call(ability)
  new(ability).call
  ability
end

Instance Method Details

#callObject

Applies abilities definitions with ‘can` and `cannot`.

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/ddr/auth/ability_definitions.rb', line 20

def call
  raise NotImplementedError, "Subclasses must implement `#call`."
end