Class: KSExpression::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/kansas/Expression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*tables) ⇒ Context

Returns a new instance of Context.



26
27
28
29
30
31
32
33
34
35
# File 'lib/kansas/Expression.rb', line 26

def initialize(*tables)
#     @select = tables.collect {|t| t.table_name}
  @select = tables[0].table_name
  @select_table = tables[0]
  @tables = []
  @joins = []
  @sort_fields = []
  @limits = []
  @distinct = {}
end

Instance Attribute Details

#distinctObject (readonly)

Returns the value of attribute distinct.



24
25
26
# File 'lib/kansas/Expression.rb', line 24

def distinct
  @distinct
end

#joinsObject (readonly)

Returns the value of attribute joins.



24
25
26
# File 'lib/kansas/Expression.rb', line 24

def joins
  @joins
end

#limitsObject (readonly)

Returns the value of attribute limits.



24
25
26
# File 'lib/kansas/Expression.rb', line 24

def limits
  @limits
end

#selectObject (readonly)

Returns the value of attribute select.



24
25
26
# File 'lib/kansas/Expression.rb', line 24

def select
  @select
end

#select_tableObject (readonly)

Returns the value of attribute select_table.



24
25
26
# File 'lib/kansas/Expression.rb', line 24

def select_table
  @select_table
end

#sort_fieldsObject (readonly)

Returns the value of attribute sort_fields.



24
25
26
# File 'lib/kansas/Expression.rb', line 24

def sort_fields
  @sort_fields
end

#tablesObject (readonly)

Returns the value of attribute tables.



24
25
26
# File 'lib/kansas/Expression.rb', line 24

def tables
  @tables
end