Class: Core::Endpoint::BasicHandler::Actions::Guards::GuardChain

Inherits:
Object
  • Object
show all
Defined in:
app/api/core/endpoint/basic_handler/actions/guards.rb

Instance Method Summary collapse

Constructor Details

#initializeGuardChain

Returns a new instance of GuardChain


20
21
22
# File 'app/api/core/endpoint/basic_handler/actions/guards.rb', line 20

def initialize
  @guards = []
end

Instance Method Details

#execute(object) ⇒ Object


26
27
28
29
30
# File 'app/api/core/endpoint/basic_handler/actions/guards.rb', line 26

def execute(object)
  return true if @guards.empty?

  @guards.all? { |guard| guard.execute(object) }
end