Class: Rustic::Configs::Check

Inherits:
Object
  • Object
show all
Includes:
HooksExt
Defined in:
lib/rustic/configs/check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HooksExt

#after, #before

Constructor Details

#initializeCheck

Returns a new instance of Check.



8
9
10
11
12
# File 'lib/rustic/configs/check.rb', line 8

def initialize
  @check_unused = false
  @read_data_subset = nil
  @with_cache = false
end

Instance Attribute Details

#check_unusedObject (readonly)

Returns the value of attribute check_unused.



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

def check_unused
  @check_unused
end

#read_data_subsetObject (readonly)

Returns the value of attribute read_data_subset.



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

def read_data_subset
  @read_data_subset
end

#with_cacheObject (readonly)

Returns the value of attribute with_cache.



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

def with_cache
  @with_cache
end

Instance Method Details

#check_unused!Object



14
# File 'lib/rustic/configs/check.rb', line 14

def check_unused! = @check_unused = true

#subset(percent) ⇒ Object

Raises:

  • (ArgumentError)


17
18
19
20
21
# File 'lib/rustic/configs/check.rb', line 17

def subset(percent)
  raise ArgumentError, "percent must be > 0 and <= 100. Given: #{percent}" if percent <= 0 || percent > 100

  @read_data_subset = percent
end

#with_cache!Object



15
# File 'lib/rustic/configs/check.rb', line 15

def with_cache! = @with_cache = true