Class used to evaluate json_table blocks and nested blocks
Attributes
| columns | [R] |
Return array of column information recorded for the instance |
Public Class methods
columns(&block)
[show source]
# File lib/sequel/extensions/pg_json_ops.rb 1186 def self.columns(&block) 1187 new(&block).columns.freeze 1188 end
new(&block)
[show source]
# File lib/sequel/extensions/pg_json_ops.rb 1190 def initialize(&block) 1191 @columns = [] 1192 instance_exec(&block) 1193 end
Public Instance methods
Bignum(name, opts=OPTS)
Include a bigint column
[show source]
# File lib/sequel/extensions/pg_json_ops.rb 1216 def Bignum(name, opts=OPTS) 1217 @columns << [:column, name, :Bignum, opts].freeze 1218 end
column(name, type, opts=OPTS)
Include a regular column with the given type
[show source]
# File lib/sequel/extensions/pg_json_ops.rb 1201 def column(name, type, opts=OPTS) 1202 @columns << [:column, name, type, opts].freeze 1203 end
exists(name, type, opts=OPTS)
Include an EXISTS column with the given type
[show source]
# File lib/sequel/extensions/pg_json_ops.rb 1206 def exists(name, type, opts=OPTS) 1207 @columns << [:exists, name, type, opts].freeze 1208 end
nested(path, &block)
Include a nested set of columns at the given path.
[show source]
# File lib/sequel/extensions/pg_json_ops.rb 1211 def nested(path, &block) 1212 @columns << [:nested, path, ColumnDSL.columns(&block)].freeze 1213 end
ordinality(name)
Include a FOR ORDINALITY column
[show source]
# File lib/sequel/extensions/pg_json_ops.rb 1196 def ordinality(name) 1197 @columns << [:ordinality, name].freeze 1198 end