Extract `#check_value_to_encode`.

It's unclear why travis is complaining about ABC complexity now.  It
certainly isn't doing so locally.  I suspect gem version mismatches,
but I don't know how that would arise either.