# class PG::TextEncoder::JSON

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) click to toggle source

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