Class: Restforce::Query
- Inherits:
-
Object
- Object
- Restforce::Query
- Includes:
- Enumerable
- Defined in:
- lib/restforce/query.rb,
lib/restforce/query/builder.rb,
lib/restforce/query/version.rb,
lib/restforce/query/where_renderer.rb
Overview
This is the main entry point for starting a query Chain calls to: select, where, distinct, from, group_by, limit or select_distinct to use it
Defined Under Namespace
Classes: Builder, WhereRenderer
Constant Summary collapse
- VERSION =
'0.1.1'.freeze
Instance Method Summary collapse
- #each ⇒ Object
- #execute ⇒ Object
- #find ⇒ Object
-
#initialize(query_builder = Builder.new) ⇒ Query
constructor
A new instance of Query.
Constructor Details
Instance Method Details
#each ⇒ Object
37 38 39 |
# File 'lib/restforce/query.rb', line 37 def each execute end |
#execute ⇒ Object
30 31 32 33 34 35 |
# File 'lib/restforce/query.rb', line 30 def execute return @results if @results.present? query = @query_builder.to_s Rails.logger.debug(query) @results = @salesforce.query(query) end |
#find ⇒ Object
41 42 43 44 45 |
# File 'lib/restforce/query.rb', line 41 def find @query_builder.limit(1) execute @results.first end |