Class: DB::Model::Statement::Multiple

Inherits:
Object
  • Object
show all
Defined in:
lib/db/model/statement/multiple.rb

Instance Method Summary collapse

Constructor Details

#initialize(things) ⇒ Multiple

Returns a new instance of Multiple.



10
11
12
# File 'lib/db/model/statement/multiple.rb', line 10

def initialize(things)
  @things = things
end

Instance Method Details

#append_to(statement) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/db/model/statement/multiple.rb', line 14

def append_to(statement)
  first = true
  
  @things.each do |thing|
    statement.clause(",") unless first
    first = false
    
    thing.append_to(statement)
  end
  
  return statement
end