Module: ROM::SQL::Types::PG::JSONMethods
- Defined in:
- lib/rom/sql/extensions/postgres/types.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.[](type, wrap) ⇒ Object
318 319 320 321 322 323 324 325 |
# File 'lib/rom/sql/extensions/postgres/types.rb', line 318 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
327 328 329 |
# File 'lib/rom/sql/extensions/postgres/types.rb', line 327 def get(type, expr, *path) Attribute[json_type].(sql_expr: wrap(expr)[path_args(path)]) end |
#get_text(type, expr, *path) ⇒ Object
331 332 333 |
# File 'lib/rom/sql/extensions/postgres/types.rb', line 331 def get_text(type, expr, *path) Attribute[Types::String].(sql_expr: wrap(expr).get_text(path_args(path))) end |