Is there a way to display a Ruby hash as a JS object without quotes for certain values in the hash, essentially as JS code? For instance, consider the following Ruby code:
{ foo: proc { 'someJavascriptFn()' } }.to_json
How can I have the JS output as:
{ foo: someJavascriptFn() }
Is it possible to achieve this without making modifications to proc
or hash
?