Class: Sequel::Postgres::Dataset
- Inherits:
-
Object
- Object
- Sequel::Postgres::Dataset
- Defined in:
- lib/pg_json/sequel/pg_json.rb
Instance Method Summary collapse
Instance Method Details
#json ⇒ Object
108 109 110 111 112 113 114 115 116 117 |
# File 'lib/pg_json/sequel/pg_json.rb', line 108 def json if f = self.first JSON.parse(f[:to_json]).tap do |h| h.recursively_symbolize_keys! h.json_typify! end else nil end end |
#json_array ⇒ Object
100 101 102 103 104 105 106 107 |
# File 'lib/pg_json/sequel/pg_json.rb', line 100 def json_array self.all.map do |r| JSON.parse(r[:to_json]).tap do |h| h.recursively_symbolize_keys! h.json_typify! end end end |