Class: ActiveRecord::ConnectionAdapters::DatabaseStatements::PartialQueryCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/connection_adapters/abstract/database_statements.rb

Instance Method Summary collapse

Constructor Details

#initializePartialQueryCollector

Returns a new instance of PartialQueryCollector.



505
506
507
508
# File 'lib/active_record/connection_adapters/abstract/database_statements.rb', line 505

def initialize
  @parts = []
  @binds = []
end

Instance Method Details

#<<(str) ⇒ Object



510
511
512
513
# File 'lib/active_record/connection_adapters/abstract/database_statements.rb', line 510

def <<(str)
  @parts << str
  self
end

#add_bind(obj) ⇒ Object



515
516
517
518
519
# File 'lib/active_record/connection_adapters/abstract/database_statements.rb', line 515

def add_bind(obj)
  @binds << obj
  @parts << Arel::Nodes::BindParam.new(1)
  self
end

#valueObject



521
522
523
# File 'lib/active_record/connection_adapters/abstract/database_statements.rb', line 521

def value
  [@parts, @binds]
end