Class: ActiveForce::CompositeBatchQuery
- Inherits:
-
Object
- Object
- ActiveForce::CompositeBatchQuery
- Defined in:
- lib/active_force/composite_batch_query.rb
Instance Attribute Summary collapse
-
#sfdc_client ⇒ Object
readonly
Returns the value of attribute sfdc_client.
-
#soql ⇒ Object
readonly
Returns the value of attribute soql.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(soql, sfdc_client) ⇒ CompositeBatchQuery
constructor
A new instance of CompositeBatchQuery.
Constructor Details
#initialize(soql, sfdc_client) ⇒ CompositeBatchQuery
Returns a new instance of CompositeBatchQuery.
11 12 13 14 |
# File 'lib/active_force/composite_batch_query.rb', line 11 def initialize(soql, sfdc_client) @sfdc_client = sfdc_client @soql = soql end |
Instance Attribute Details
#sfdc_client ⇒ Object (readonly)
Returns the value of attribute sfdc_client.
9 10 11 |
# File 'lib/active_force/composite_batch_query.rb', line 9 def sfdc_client @sfdc_client end |
#soql ⇒ Object (readonly)
Returns the value of attribute soql.
9 10 11 |
# File 'lib/active_force/composite_batch_query.rb', line 9 def soql @soql end |
Class Method Details
.call(soql, sfdc_client = ActiveForce.sfdc_client) ⇒ Object
5 6 7 |
# File 'lib/active_force/composite_batch_query.rb', line 5 def self.call(soql, sfdc_client = ActiveForce.sfdc_client) new(soql, sfdc_client).call end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/active_force/composite_batch_query.rb', line 16 def call results = sfdc_client.batch do |subrequests| subrequests.requests << { method: "GET", url: "v#{subrequests.[:api_version]}/query?" + {q: soql}.to_query } end r = results.first process_composite_batch_error_response(r) if r.statusCode >= 300 r.result end |