Module: UState::QueryString::Or2

Defined in:
lib/ustate/query_string.rb

Instance Method Summary collapse

Instance Method Details

#queryObject



37
38
39
40
41
# File 'lib/ustate/query_string.rb', line 37

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

#sqlObject



43
44
45
46
47
48
# File 'lib/ustate/query_string.rb', line 43

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