Class: Core::Endpoint::BasicHandler::Actions::Guards::GuardChain
- Inherits:
-
Object
- Object
- Core::Endpoint::BasicHandler::Actions::Guards::GuardChain
- Defined in:
- app/api/core/endpoint/basic_handler/actions/guards.rb
Instance Method Summary collapse
- #execute(object) ⇒ Object
-
#initialize ⇒ GuardChain
constructor
A new instance of GuardChain.
Constructor Details
#initialize ⇒ GuardChain
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 |