Class: Detectify::QueryBuilder::SQL

Inherits:
Base
  • Object
show all
Defined in:
lib/detectify/query_builder/sql.rb

Instance Attribute Summary

Attributes inherited from Base

#domain, #subdomain

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Detectify::QueryBuilder::Base

Instance Method Details

#buildObject



4
5
6
7
8
9
10
11
# File 'lib/detectify/query_builder/sql.rb', line 4

def build
  @query ||= begin
    query = ["#{domain_clause}#{or_operator}#{subdomain_clause}"]
    query << domain if need_domain_clause?
    query << subdomain if need_subdomain_clause?
    query.compact
  end
end