sf_connect 0.2.2 → 0.2.4

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: cdab593ae705aa3e91a638d9d7679cd4f40c988b3d261242cf61f4ed20155d16
4
- data.tar.gz: 97bd41340a528b7fbfac2125d7895f1c66bc3265f351e7dab738c08179468deb
3
+ metadata.gz: 65588d4e1da204c609c305cd8f5b4200a6bf2a4fd1743bb66de88673f4631d2b
4
+ data.tar.gz: 6c341435a6e38ff30c6d588b48bf1d348f7424598139b9960c4a56cc903a6c4f
5
5
  SHA512:
6
- metadata.gz: 3cd8e3776446c9fa0f4a077ecddc6940be8c3f3ffd65f5e5a03ed23f14c972d2da89747cfc7fc890deddeb3b317c193cc9b0ad59f75a4af3f2f30e5252831945
7
- data.tar.gz: 1abf6aee240460bacac1304ca666cc924842fd5bde5ebe41302c6b9fa0d636c35bcc1186761496c4169d54ef6c2c925b9ad4fd47d9d47fc31ded2b9a50f6700f
6
+ metadata.gz: 6bae46cd083be9b30eba9eec6c5a5ee98229b558202bcfe3ca440028a54c51d2462ad4015fcee5aae9c83584ff80db086ed863a45c8bfb1430fa58f0469965ed
7
+ data.tar.gz: 4aeac60e2b89afc22d9d1345e40a6bd86dcdcfe8e8cebc327a91453d46ec3da36621d0270835dac999619bbd882499ebfcd4c3cdaea9a43cd414866414bc850c
@@ -1,3 +1,3 @@
1
1
  module SfConnect
2
- VERSION = "0.2.2".freeze
2
+ VERSION = "0.2.4".freeze
3
3
  end
data/lib/sf_connect.rb CHANGED
@@ -17,24 +17,32 @@ module SfConnect
17
17
  SfConnect::Define.new(salesforce_object_name, where:, fields:, &).call
18
18
  end
19
19
 
20
+ def connect
21
+ yield Restforce.new
22
+ end
23
+
20
24
  def query(soql)
21
- Restforce.new.query(soql)
25
+ connect { |restforce| restforce.query(soql) }
22
26
  end
23
27
 
24
28
  def find(salesforce_object_name, id, field)
25
- Restforce.new.find(salesforce_object_name, id, field)
29
+ connect { |restforce| restforce.find(salesforce_object_name, id, field) }
26
30
  end
27
31
 
28
32
  def create!(salesforce_object_name, payload)
29
- Restforce.new.create!(
30
- salesforce_object_name, payload
31
- )
33
+ connect do |restforce|
34
+ restforce.create!(
35
+ salesforce_object_name, payload
36
+ )
37
+ end
32
38
  end
33
39
 
34
40
  def update!(salesforce_object_name, id, payload)
35
- Restforce.new.update!(
36
- salesforce_object_name, { Id: id, **payload }
37
- )
41
+ connect do |restforce|
42
+ restforce.update!(
43
+ salesforce_object_name, { Id: id, **payload }
44
+ )
45
+ end
38
46
  end
39
47
  end
40
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sf_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masa (Aileron inc)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-27 00:00:00.000000000 Z
11
+ date: 2023-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: restforce