lib/clamped/symbol.rb in clamped-0.1.0 vs lib/clamped/symbol.rb in clamped-1.0.0

- old
+ new

@@ -1,15 +1,16 @@ # frozen_string_literal: true class Symbol - def clamped(whitelist, strict: true) + def clamped(whitelist, strict: true, default: nil) is_included = proc do |item| if strict item == self else item.to_sym == self end end return self if whitelist.any?(is_included) + default end end