module WannabeBool::String

Constants

FALSES
TRUES

Public Instance Methods

to_b() click to toggle source
# File lib/wannabe_bool/string.rb, line 6
def to_b
  value = self.strip.downcase
  return true  if TRUES.include?(value)
  return false if FALSES.include?(value)

  WannabeBool.invalid_value_behaviour.call
end