restforce-query 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75c8a810c685a0630bee8b8f02811264e45c8434e5edff0a8908b80eaf50e729
4
- data.tar.gz: f9a68dc2dbb3c5dd52e61d043d3bed82f2a5bc4be3ba796531b3d4cb5f79aac1
3
+ metadata.gz: 89dba9bae198cbe1532f97b46acb1b59fde9808bffdad2c943456213a1e78bf6
4
+ data.tar.gz: e188f010731e0019a6366535c596de7aeadefca82d5cd8cdb5908376f083685d
5
5
  SHA512:
6
- metadata.gz: 034aa4017d7313b2e10caa22a1638a7934c910835727d1939c66333e6c2bce8d31f2df156323c0b06dfbcdc351ee642b5cb62f63937632133b07f4cfde887067
7
- data.tar.gz: 6cb839f3da6a3c078dc973a4d577a2eeba0babcd2b6b8020938625b2e15cc9a9cb5614d59555d730a00d10beaa63c842a7b99c58ea083b6a5a171bea90684050
6
+ metadata.gz: a10f3a27cfde112764f90dfc74081869d465ac8f23df6f3648799bdbc41f707d322a30acc36e3860c743dcaaee7b9ee7aa037f70ff7525096e2a1f671ad0b3c6
7
+ data.tar.gz: '0796c933f3ffc8c468db9e5ce74e3b28864bf7c784e937aac0f414ec62d219513c40274533f51dd244eaa14d0bd0c819847e832a0f8c440631ff2f81fe79bb22'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- restforce-query (0.1.1)
4
+ restforce-query (0.1.2)
5
5
  restforce (~> 2.5.3)
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  module Restforce
2
2
  class Query
3
- VERSION = '0.1.1'.freeze
3
+ VERSION = '0.1.2'.freeze
4
4
  end
5
5
  end
@@ -8,9 +8,9 @@ module Restforce
8
8
  # Chain calls to: select, where, distinct, from, group_by, limit or select_distinct to use it
9
9
  class Query
10
10
  include Enumerable
11
- def initialize(query_builder = Builder.new)
11
+ def initialize(query_builder = Builder.new, restforce_client = Restforce.new)
12
12
  @query_builder = query_builder
13
- @salesforce = Restforce.new
13
+ @restforce_client = restforce_client
14
14
  end
15
15
 
16
16
  %i[select select_distinct distinct where from group_by limit].each do |method_name|
@@ -28,14 +28,13 @@ module Restforce
28
28
  end
29
29
 
30
30
  def execute
31
- return @results if @results.present?
31
+ return @results unless @results.nil?
32
32
  query = @query_builder.to_s
33
- Rails.logger.debug(query)
34
- @results = @salesforce.query(query)
33
+ @results = @restforce_client.query(query)
35
34
  end
36
35
 
37
- def each
38
- execute
36
+ def each(&block)
37
+ execute.each(&block)
39
38
  end
40
39
 
41
40
  def find
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restforce-query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Santiago Ocamica
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-16 00:00:00.000000000 Z
11
+ date: 2018-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler