class Configuration

Constants

COMPARISON_LEVELS
DEFAULT_COMPARISON_LEVEL

Attributes

comparison_level[RW]
excluded_models[RW]
output_path[RW]

Public Class Methods

new(excluded_models: [], output_path: "db_mirrored", comparison_level: DEFAULT_COMPARISON_LEVEL) click to toggle source
# File lib/cli/app/configuration.rb, line 13
def initialize(excluded_models: [], output_path: "db_mirrored", comparison_level: DEFAULT_COMPARISON_LEVEL)
  self.excluded_models = excluded_models
  self.output_path = output_path
  self.comparison_level = COMPARISON_LEVELS[comparison_level] || DEFAULT_COMPARISON_LEVEL
end

Public Instance Methods

from_hash(hash_object) click to toggle source
# File lib/cli/app/configuration.rb, line 33
def from_hash(hash_object)
end
valid_attributes!() click to toggle source
# File lib/cli/app/configuration.rb, line 19
def valid_attributes!
  if !excluded_models.is_a?(Array)
    raise("Invalid excluded_models value! Was expecting an array")
  end

  if !output_path.present?
    raise("Invalid output_path value! Expected non empty string")
  end

  if COMPARISON_LEVELS.invert[comparison_level].nil?
    raise("Invalid comparison_level value! Expected a value between 1-4")
  end
end