Class: Grover::OptionsFixer

Inherits:
Object show all
Defined in:
lib/grover/options_fixer.rb

Overview

Convert string option values to boolean, numeric, and array literals

Constant Summary collapse

FALSE_VALUES =
[nil, false, 0, '0', 'f', 'F', 'false', 'FALSE', 'off', 'OFF'].freeze

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ OptionsFixer

Returns a new instance of OptionsFixer.


12
13
14
# File 'lib/grover/options_fixer.rb', line 12

def initialize(options)
  @options = options
end

Instance Method Details

#runObject


16
17
18
19
20
21
22
# File 'lib/grover/options_fixer.rb', line 16

def run
  fix_boolean_options!
  fix_integer_options!
  fix_float_options!
  fix_array_options!
  @options
end