Sha256: 4fe3262181a05f0b2e3252e924cc28ab81c00f398b58daec1fe05bf0cfb4648d
Contents?: true
Size: 831 Bytes
Versions: 12
Compression:
Stored size: 831 Bytes
Contents
module Bmg module Sql class Processor class OrderBy < Processor def initialize(ordering, builder) super(builder) @ordering = ordering end attr_reader :ordering def on_set_operator(sexpr) call(builder.from_self(sexpr)) end alias :on_union :on_set_operator alias :on_except :on_set_operator alias :on_intersect :on_set_operator def on_select_exp(sexpr) if sexpr.order_by? || sexpr.group_by? sexpr = builder.from_self(sexpr) call(sexpr) else needed = builder.order_by_clause(ordering, &sexpr.desaliaser) sexpr.dup.push(needed) end end end # class OrderBy end # class Processor end # module Sql end # module Bmg
Version data entries
12 entries across 12 versions & 1 rubygems