Maybe I get the idea of a coercer backwards, but the docs seem to describe what I would expect:
string_coercer = Coercible::Coercer.new[String]
string_coercer.coerced?(string_coercer.to_boolean('1')) # => true
# in general:
# x_coercer.coerced?(<value not of type X>) # => true
# x_coercer.coerced?(<value of type X>) # => false
The implementation of
#coerced?
is not in line with the documentation (and seems counterintuitive).The docs state:
The actual behavior is:
Maybe I get the idea of a coercer backwards, but the docs seem to describe what I would expect:
Let me know - I can submit a PR either way.