Class: Rustic::CommandBuilders::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/rustic/command_builders/check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Check

Returns a new instance of Check.



6
7
8
# File 'lib/rustic/command_builders/check.rb', line 6

def initialize(config)
  @config = config.check_config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/rustic/command_builders/check.rb', line 4

def config
  @config
end

Instance Method Details

#buildObject



10
11
12
13
14
15
16
17
# File 'lib/rustic/command_builders/check.rb', line 10

def build
  [
    "check",
    @config&.check_unused ? "--check-unused" : nil,
    read_data_subset,
    @config&.with_cache ? "--with-cache" : nil
  ].compact
end