Number to words problem
You should use Ruby's Numeric#divmod function:

writing, integer = integer.divmod(1_000_000)


Your function parameter claims to accept an integer, so you should also handle negative inputs.  (It shouldn't be hard to prepend "negative " and flip the sign.)