Module: Nenv::Environment::Loader::Predicate

Defined in:
lib/nenv/environment/loader/predicate.rb

Class Method Summary collapse

Class Method Details

.call(raw_value) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/nenv/environment/loader/predicate.rb', line 4

def self.call(raw_value)
  case raw_value
  when nil
    nil
  when ''
    fail ArgumentError, "Can't convert empty string into Bool"
  when '0', 'false', 'n', 'no', 'NO', 'FALSE'
    false
  else
    true
  end
end