lib/koine/attributes/adapter/boolean.rb in koine-attributes-0.2.3 vs lib/koine/attributes/adapter/boolean.rb in koine-attributes-0.3.0
- old
+ new
@@ -11,29 +11,29 @@
)
@true_values = true_values
@false_values = false_values
end
- def coerce(value)
- return true if true_values.include?(value)
- return false if false_values.include?(value)
- raise ArgumentError, "Invalid argument '#{value}'"
- end
-
def append_true_value(value)
true_values << value
self
end
def append_false_value(value)
false_values << value
self
end
- protected
+ private
attr_reader :true_values
attr_reader :false_values
+
+ def coerce_not_nil(value)
+ return true if true_values.include?(value)
+ return false if false_values.include?(value)
+ raise ArgumentError, "Invalid argument '#{value}'"
+ end
end
end
end
end