Class: Agent::Lock::CLI::Commands::Release
- Inherits:
-
TreeCommand
- Object
- Dry::CLI::Command
- Base
- TreeCommand
- Agent::Lock::CLI::Commands::Release
- Defined in:
- lib/agent/lock/cli/commands/release.rb
Overview
Give a scope back.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#call(scope:, **options) ⇒ Manager::Result
:released, :not_found or :refused.
Methods inherited from TreeCommand
Methods inherited from Base
Constructor Details
This class inherits a constructor from Agent::Lock::CLI::Commands::Base
Instance Method Details
#call(scope:, **options) ⇒ Manager::Result
Returns :released, :not_found or :refused.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/agent/lock/cli/commands/release.rb', line 20 def call(scope:, **) result = manager().release(scope) case result.status when :released then say("RELEASED #{scope_of(result.record)}") when :not_found then say("NOT LOCKED #{scope}") when :refused warn_("REFUSED: #{scope_of(result.record)} is held by #{holder_of(result.record)}, not you") end finish(result) end |