Class: Lab42::Options::ErrorIssuer

Inherits:
Object
  • Object
show all
Defined in:
lib/lab42/options/error_issuer.rb

Constant Summary collapse

Symbolize =
-> (s){ s.to_sym.inspect }

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/lab42/options/error_issuer.rb', line 7

def options
  @options
end

#validatorObject (readonly)

Returns the value of attribute validator.



7
8
9
# File 'lib/lab42/options/error_issuer.rb', line 7

def validator
  @validator
end

Instance Method Details

#handle_errors!Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lab42/options/error_issuer.rb', line 9

def handle_errors!
  
  if options.error_mode?
    raise_errors_for_missing true
  elsif options.warning_mode?
    warn_for_spurious
    raise_errors_for_missing
  else
    raise_errors_for_missing
  end
end