I'm building a file-manipulation API in Rails, and I need to be able to access it via a separate gem. The API uses Carrierwave, and that piece works with no trouble. What I don't understand how to do is to take an arbitrary file and deliver it to the API from the gem interface.
Carrierwave takes its files as either the results of File.open('foo.jpg')
or as a POST from a file field. I'm really not sure what either is doing, though, to serialize the file and send it along.
How do I take the contents of a file and turn that into something I can pass around and post via JSON?