Class: SMPTool::CLI::Executor::VolReadWriteOperator

Inherits:
VolReadOperator show all
Includes:
BinWriteMixin
Defined in:
lib/smp_tool/cli/executor/vol_read_write_operator.rb

Overview

Base class for the executors that read a volume and do an operation on it, then save the state back to a file.

Direct Known Subclasses

Deleter, Pusher, Renamer, Resizer, Squeezer

Instance Method Summary collapse

Methods inherited from VolReadOperator

#initialize

Constructor Details

This class inherits a constructor from SMPTool::CLI::Executor::VolReadOperator

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
# File 'lib/smp_tool/cli/executor/vol_read_write_operator.rb', line 13

def call
  _save_volume(path: @options[:output], volume: @volume, **@options) if @options.key?(:output)
  _save_volume(path: @input, volume: @volume, **@options) if @options[:apply]

  return if @options.key?(:output) || @options[:apply]

  @logger.warning "Changes were not saved since you didn't specify the output file " \
                  "or the `-a` option to apply changes to the input file"
end