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

#initialize ⇒ Query

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

#conditions ⇒ Object

Returns the value of attribute conditions.



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

def conditions
  @conditions
end

#limit ⇒ Object

Returns the value of attribute limit.



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

def limit
  @limit
end

#offset ⇒ Object

Returns the value of attribute offset.



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

def offset
  @offset
end

#remote_limit ⇒ Object

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_offset ⇒ Object

Returns the value of attribute remote_offset.



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

def remote_offset
  @remote_offset
end

#reverse ⇒ Object

Returns the value of attribute reverse.



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

def reverse
  @reverse
end

#sanitize ⇒ Object

Returns the value of attribute sanitize.



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

def sanitize
  @sanitize
end

#select ⇒ Object

Returns the value of attribute select.



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

def select
  @select
end

#sort ⇒ Object

Returns the value of attribute sort.



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

def sort
  @sort
end

#sort_descending ⇒ Object

Returns the value of attribute sort_descending.



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

def sort_descending
  @sort_descending
end

#table ⇒ Object

Returns the value of attribute table.



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

def table
  @table
end

#tail ⇒ Object

Returns the value of attribute tail.



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

def tail
  @tail
end

#truncate ⇒ Object

Returns the value of attribute truncate.



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

def truncate
  @truncate
end

#unique ⇒ Object

Returns the value of attribute unique.



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

def unique
  @unique
end

#uses ⇒ Object

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_s ⇒ Object

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