Class: Rustic::CommandBuilders::Check
- Inherits:
-
Object
- Object
- Rustic::CommandBuilders::Check
- Defined in:
- lib/rustic/command_builders/check.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(config) ⇒ Check
constructor
A new instance of Check.
- #read_data_subset(config) ⇒ Object
Constructor Details
#initialize(config) ⇒ Check
4 5 6 |
# File 'lib/rustic/command_builders/check.rb', line 4 def initialize(config) @config = config end |
Instance Method Details
#build ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/rustic/command_builders/check.rb', line 8 def build config = @config.check_config [ "check", config&.check_unused ? "--check-unused" : nil, read_data_subset(config), config&.with_cache ? "--with-cache" : nil ].compact end |
#read_data_subset(config) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/rustic/command_builders/check.rb', line 18 def read_data_subset(config) return nil if config.nil? || config.read_data_subset.nil? return "--read-data" if config.read_data_subset == 100 "--read-data-subset=#{config.read_data_subset}%" end |