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.



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

def initialize
  @guards = []
end

Instance Method Details

#execute(object) ⇒ Object



31
32
33
34
35
# File 'app/api/core/endpoint/basic_handler/actions/guards.rb', line 31

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

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