Module: ROM::SQL::Postgres::Types::JSONMethods
- Defined in:
- lib/rom/sql/extensions/postgres/types/json.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.[](type, wrap) ⇒ Object
224 225 226 227 228 229 230 231 |
# File 'lib/rom/sql/extensions/postgres/types/json.rb', line 224 def self.[](type, wrap) parent = self Module.new do include parent define_method(:json_type) { type } define_method(:wrap, wrap) end end |
Instance Method Details
#get(_type, expr, *path) ⇒ Object
233 234 235 |
# File 'lib/rom/sql/extensions/postgres/types/json.rb', line 233 def get(_type, expr, *path) Attribute[json_type].(sql_expr: wrap(expr)[path_args(path)]) end |