Method: QueryInterface::Server::LazyQuery#with

Defined in:
lib/query-interface-server/lazy_query.rb

#with(*fields, **opts) ⇒ Object



58
59
60
61
62
63
64
65
66
67
# File 'lib/query-interface-server/lazy_query.rb', line 58

def with(*fields, **opts)
  self.copy.tap do |query|
    fields.each do |field|
      query.add_transformation("with", {field: field.to_s})
    end
    opts.each do |field, param|
      query.add_transformation("with", {field: field.to_s, param: param})
    end
  end
end