Class: Vivlio::Starter::CLI::DeleteCommands::DeleteCommandExecutor
- Inherits:
-
Object
- Object
- Vivlio::Starter::CLI::DeleteCommands::DeleteCommandExecutor
- Defined in:
- lib/vivlio/starter/cli/delete.rb
Overview
delete コマンドの制御フローを担う実行クラス
オプション解釈・対象解決・削除処理の各責務を分離し、テスト容易性と保守性を確保している。
Instance Method Summary collapse
-
#call ⇒ void
削除処理を実行する.
-
#initialize(options_source, tokens) ⇒ DeleteCommandExecutor
constructor
A new instance of DeleteCommandExecutor.
Constructor Details
#initialize(options_source, tokens) ⇒ DeleteCommandExecutor
Returns a new instance of DeleteCommandExecutor.
47 48 49 50 51 |
# File 'lib/vivlio/starter/cli/delete.rb', line 47 def initialize(, tokens) @options = DeleteOptions.new() @resolver = TargetResolver.new(tokens) @deletion = ChapterDeletion.new(@options) end |
Instance Method Details
#call ⇒ void
This method returns an undefined value.
削除処理を実行する
57 58 59 60 61 62 |
# File 'lib/vivlio/starter/cli/delete.rb', line 57 def call .apply_verbose! ensure_targets! targets.each { |basename| deletion.remove(basename) } end |