Class: ActiveRecord::Refined::AST::JsonBuild

Inherits:
Node
  • Object
show all
Includes:
ComputedJson, JsonComparable, Predications
Defined in:
lib/active_record/refined/ast.rb

Overview

A JSON document built in the row: json_array from the values given, json_object from a Ruby hash. SQLite and the MySQL family both say the standard names; PostgreSQL is asked to build jsonb, whose documents the other JSON operations here read.

Instance Method Summary collapse

Methods included from JsonComparable

#between?, #bitwise_not, #in?, #not_between?, #not_in?, #~

Methods included from Predications

#!=, #!~, #<, #<=, #==, #=~, #>, #>=, #between?, #bury, #casecmp?, #contains?, #dig, #dig_text, #distinct_from?, #end_with?, #except, #false?, #ilike?, #in?, #include?, #intersect?, #key?, #keys, #like?, #member?, #not_between?, #not_distinct_from?, #not_false?, #not_ilike?, #not_in?, #not_like?, #not_null?, #not_true?, #null?, #start_with?, #subset?, #superset?, #true?, #when

Methods inherited from Node

#as, #asc, #collate, #desc

Constructor Details

#initialize(kind, values) ⇒ JsonBuild

Returns a new instance of JsonBuild.



1350
1351
1352
1353
# File 'lib/active_record/refined/ast.rb', line 1350

def initialize(kind, values)
  @kind = kind
  @values = kind == :object ? check_pairs(values) : values
end