Class: ThinkingSphinx::ActiveRecord::SQLBuilder::ClauseBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/active_record/sql_builder/clause_builder.rb

Instance Method Summary (collapse)

Constructor Details

- (ClauseBuilder) initialize(first_element)



4
5
6
# File 'lib/thinking_sphinx/active_record/sql_builder/clause_builder.rb', line 4

def initialize(first_element)
  @first_element = first_element
end

Instance Method Details

- (Object) add_clause(clause)



13
14
15
# File 'lib/thinking_sphinx/active_record/sql_builder/clause_builder.rb', line 13

def add_clause(clause)
  self.clauses += Array(clause)
end

- (Object) compose(*additions)



8
9
10
11
# File 'lib/thinking_sphinx/active_record/sql_builder/clause_builder.rb', line 8

def compose(*additions)
  additions.each &method(:add_clause)
  self
end

- (Object) separated(by = ', ')



17
18
19
# File 'lib/thinking_sphinx/active_record/sql_builder/clause_builder.rb', line 17

def separated(by = ', ')
  clauses.flatten.compact.join(by)
end