Class: SQB::Base

Inherits:
Object
  • Object
show all
Includes:
Escaping
Defined in:
lib/sqb/base.rb

Direct Known Subclasses

Delete, Insert, Select, Update

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name, options = {}, &block) ⇒ Base

Returns a new instance of Base.



12
13
14
15
16
17
# File 'lib/sqb/base.rb', line 12

def initialize(table_name, options = {}, &block)
  @table_name = table_name
  @options = options
  @prepared_arguments = []
  block.call(self) if block_given?
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/sqb/base.rb', line 10

def options
  @options
end

#prepared_argumentsObject (readonly)

Returns the value of attribute prepared_arguments.



9
10
11
# File 'lib/sqb/base.rb', line 9

def prepared_arguments
  @prepared_arguments
end

Instance Method Details

#to_sqlString

Generate the full SQL query for this query.

Returns:

  • (String)


22
23
# File 'lib/sqb/base.rb', line 22

def to_sql
end