Class: SqlStmtLib::SqlData

Inherits:
Struct
  • Object
show all
Defined in:
lib/sqlstmt/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSqlData

Returns a new instance of SqlData.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/sqlstmt/data.rb', line 29

def initialize
  self.tables = []
  self.joins = []
  self.wheres = []
  self.where_behavior = :require
  self.fields = []
  self.values = []
  self.having = []
  self.rows = []
  self.tables_to_delete = []
  self.ignore = ''
  self.outfile = ''
  self.called_get = false
end

Instance Attribute Details

#called_getObject

Returns the value of attribute called_get

Returns:

  • (Object)

    the current value of called_get



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def called_get
  @called_get
end

#distinctObject

Returns the value of attribute distinct

Returns:

  • (Object)

    the current value of distinct



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def distinct
  @distinct
end

#fieldsObject

Returns the value of attribute fields

Returns:

  • (Object)

    the current value of fields



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def fields
  @fields
end

#group_byObject

Returns the value of attribute group_by

Returns:

  • (Object)

    the current value of group_by



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def group_by
  @group_by
end

#havingObject

Returns the value of attribute having

Returns:

  • (Object)

    the current value of having



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def having
  @having
end

#ignoreObject

Returns the value of attribute ignore

Returns:

  • (Object)

    the current value of ignore



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def ignore
  @ignore
end

#into_tableObject

Returns the value of attribute into_table

Returns:

  • (Object)

    the current value of into_table



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def into_table
  @into_table
end

#joinsObject

Returns the value of attribute joins

Returns:

  • (Object)

    the current value of joins



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def joins
  @joins
end

#limitObject

Returns the value of attribute limit

Returns:

  • (Object)

    the current value of limit



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def limit
  @limit
end

#order_byObject

Returns the value of attribute order_by

Returns:

  • (Object)

    the current value of order_by



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def order_by
  @order_by
end

#outfileObject

Returns the value of attribute outfile

Returns:

  • (Object)

    the current value of outfile



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def outfile
  @outfile
end

#replaceObject

Returns the value of attribute replace

Returns:

  • (Object)

    the current value of replace



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def replace
  @replace
end

#rowsObject

Returns the value of attribute rows

Returns:

  • (Object)

    the current value of rows



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def rows
  @rows
end

#stmt_typeObject

Returns the value of attribute stmt_type

Returns:

  • (Object)

    the current value of stmt_type



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def stmt_type
  @stmt_type
end

#straight_joinObject

Returns the value of attribute straight_join

Returns:

  • (Object)

    the current value of straight_join



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def straight_join
  @straight_join
end

#tablesObject

Returns the value of attribute tables

Returns:

  • (Object)

    the current value of tables



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def tables
  @tables
end

#tables_to_deleteObject

Returns the value of attribute tables_to_delete

Returns:

  • (Object)

    the current value of tables_to_delete



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def tables_to_delete
  @tables_to_delete
end

#valuesObject

Returns the value of attribute values

Returns:

  • (Object)

    the current value of values



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def values
  @values
end

#where_behaviorObject

Returns the value of attribute where_behavior

Returns:

  • (Object)

    the current value of where_behavior



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def where_behavior
  @where_behavior
end

#wheresObject

Returns the value of attribute wheres

Returns:

  • (Object)

    the current value of wheres



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def wheres
  @wheres
end

#with_rollupObject

Returns the value of attribute with_rollup

Returns:

  • (Object)

    the current value of with_rollup



6
7
8
# File 'lib/sqlstmt/data.rb', line 6

def with_rollup
  @with_rollup
end

Instance Method Details

#initialize_copy(orig) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/sqlstmt/data.rb', line 44

def initialize_copy(orig)
  # without this call to super, any field that we aren't dup'ing here won't be copied
  super
  self.tables = orig.tables.dup
  self.joins = orig.joins.dup
  self.wheres = orig.wheres.dup
  self.fields = orig.fields.dup
  self.values = orig.values.dup
  self.having = orig.having.dup
  self.rows = orig.rows.dup
end