PG::TextEncoder::

JSON class

This is a encoder class for conversion of Ruby Hash, Array, String, Numeric, nil values to PostgreSQL JSON/JSONB type.

As soon as this class is used, it requires the ruby standard library ‘json’.

Public Instance Methods

encode(value)
# File lib/pg/text_encoder/json.rb, line 11
def encode(value)
        ::JSON.generate(value, quirks_mode: true)
end