Class: MdbmDistSupport::Validator

Inherits:
Object
  • Object
show all
Includes:
CustomLogger
Defined in:
lib/mdbm_dist_support/validator.rb

Overview

settings input validator

Constant Summary collapse

RUN_DIST_REQUIRE_INSTANCE_VARS =
i[@lock_path @meta_path @local_path @dist_path @cmd_print
@cmd_gen @cmd_rep @full_mode @dist_servers].freeze
RUN_PRINT_AFTER_REQUIRE_INSTANCE_VARS =
i[@meta_path].freeze

Class Method Summary collapse

Class Method Details

.valid_run_dist_settings?(settings) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
22
23
24
# File 'lib/mdbm_dist_support/validator.rb', line 16

def valid_run_dist_settings?(settings)
  rc = true
  df = RUN_DIST_REQUIRE_INSTANCE_VARS - settings
  unless df.length.zero?
    @@logger.error %(#{df} is required )
    rc = false
  end
  rc
end

.valid_run_print_after_settings?(settings) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
32
33
34
# File 'lib/mdbm_dist_support/validator.rb', line 26

def valid_run_print_after_settings?(settings)
  rc = true
  df = RUN_PRINT_AFTER_REQUIRE_INSTANCE_VARS - settings
  unless df.length.zero?
    @@logger.error %(#{df} is required)
    rc = false
  end
  rc
end