Class: YqlQuery::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/yql_query/query.rb

Overview

The object underlying Builder which stores and generates the query.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeQuery

Returns a new instance of Query.



9
10
11
12
# File 'lib/yql_query/query.rb', line 9

def initialize
  self.conditions = []
  self.uses = []
end

Instance Attribute Details

#conditionsObject

Returns the value of attribute conditions.



5
6
7
# File 'lib/yql_query/query.rb', line 5

def conditions
  @conditions
end

#limitObject

Returns the value of attribute limit.



5
6
7
# File 'lib/yql_query/query.rb', line 5

def limit
  @limit
end

#offsetObject

Returns the value of attribute offset.



5
6
7
# File 'lib/yql_query/query.rb', line 5

def offset
  @offset
end

#remote_limitObject

Returns the value of attribute remote_limit.



7
8
9
# File 'lib/yql_query/query.rb', line 7

def remote_limit
  @remote_limit
end

#remote_offsetObject

Returns the value of attribute remote_offset.



7
8
9
# File 'lib/yql_query/query.rb', line 7

def remote_offset
  @remote_offset
end

#reverseObject

Returns the value of attribute reverse.



6
7
8
# File 'lib/yql_query/query.rb', line 6

def reverse
  @reverse
end

#sanitizeObject

Returns the value of attribute sanitize.



6
7
8
# File 'lib/yql_query/query.rb', line 6

def sanitize
  @sanitize
end

#selectObject

Returns the value of attribute select.



5
6
7
# File 'lib/yql_query/query.rb', line 5

def select
  @select
end

#sortObject

Returns the value of attribute sort.



6
7
8
# File 'lib/yql_query/query.rb', line 6

def sort
  @sort
end

#sort_descendingObject

Returns the value of attribute sort_descending.



7
8
9
# File 'lib/yql_query/query.rb', line 7

def sort_descending
  @sort_descending
end

#tableObject

Returns the value of attribute table.



5
6
7
# File 'lib/yql_query/query.rb', line 5

def table
  @table
end

#tailObject

Returns the value of attribute tail.



6
7
8
# File 'lib/yql_query/query.rb', line 6

def tail
  @tail
end

#truncateObject

Returns the value of attribute truncate.



6
7
8
# File 'lib/yql_query/query.rb', line 6

def truncate
  @truncate
end

#uniqueObject

Returns the value of attribute unique.



6
7
8
# File 'lib/yql_query/query.rb', line 6

def unique
  @unique
end

#usesObject

Returns the value of attribute uses.



5
6
7
# File 'lib/yql_query/query.rb', line 5

def uses
  @uses
end

Instance Method Details

#to_sObject

generates a query based on it’s attributes



15
16
17
# File 'lib/yql_query/query.rb', line 15

def to_s
  [use_statement, select_statement, conditions_statement, limit_offset_statement, filter_statement].join(' ').squeeze(' ').strip
end