Class: ActiveRecord::StatementCache::PartialQueryCollector

Inherits:
Object
  • Object
show all
Defined in:
activerecord/lib/active_record/statement_cache.rb

Instance Method Summary collapse

Constructor Details

#initializePartialQueryCollector

Returns a new instance of PartialQueryCollector.



60
61
62
63
# File 'activerecord/lib/active_record/statement_cache.rb', line 60

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

Instance Method Details

#<<(str) ⇒ Object



65
66
67
68
# File 'activerecord/lib/active_record/statement_cache.rb', line 65

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

#add_bind(obj) ⇒ Object



70
71
72
73
74
# File 'activerecord/lib/active_record/statement_cache.rb', line 70

def add_bind(obj)
  @binds << obj
  @parts << Substitute.new
  self
end

#valueObject



76
77
78
# File 'activerecord/lib/active_record/statement_cache.rb', line 76

def value
  [@parts, @binds]
end