lib/koine/attributes/adapter/boolean.rb in koine-attributes-1.2.3 vs lib/koine/attributes/adapter/boolean.rb in koine-attributes-1.2.4
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Koine
module Attributes
module Adapter
class Boolean < Base
DEFAULT_TRUE_VALUES = [1, '1', true, 'true'].freeze
@@ -29,9 +31,10 @@
attr_reader :false_values
def coerce_not_nil(value)
return true if true_values.include?(value)
return false if false_values.include?(value)
+
raise InvalidAttributeError.new("Invalid argument '#{value}'", attribute_name)
end
end
end
end