Class: Sequel::Postgres::Dataset

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_json/sequel/pg_json.rb

Instance Method Summary collapse

Instance Method Details

#jsonObject



75
76
77
78
79
80
81
82
83
84
# File 'lib/pg_json/sequel/pg_json.rb', line 75

def json
  if self.first
    JSON.parse(self.first[:to_json]).tap do |h|
      h.recursively_symbolize_keys!
      h.json_typify!
    end
  else
    nil
  end
end