Module: UState::QueryString::And2

Defined in:
lib/ustate/query_string.rb

Instance Method Summary collapse

Instance Method Details

#queryObject



144
145
146
147
148
# File 'lib/ustate/query_string.rb', line 144

def query
  rest.elements.map { |x| x.p }.inject(first.query) do |a, sub|
    Query::And.new a, sub.query
  end
end

#sqlObject



150
151
152
153
154
155
# File 'lib/ustate/query_string.rb', line 150

def sql
  rest.elements.map { |x| x.p }.
    inject(first.sql) do |a, sub|
      a & sub.sql
    end
end