sf_connect 0.2.2 → 0.2.3

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: f8db480f58bf437229d4a2514b8c145c870bcff9931be3948c268ececf5ce90e
4
+ data.tar.gz: cd5cedda64562b26e30887bdf8e622c66268c2c04d5a6510fa520a8c1e7f3bd6
5
5
  SHA512:
6
- metadata.gz: 3cd8e3776446c9fa0f4a077ecddc6940be8c3f3ffd65f5e5a03ed23f14c972d2da89747cfc7fc890deddeb3b317c193cc9b0ad59f75a4af3f2f30e5252831945
7
- data.tar.gz: 1abf6aee240460bacac1304ca666cc924842fd5bde5ebe41302c6b9fa0d636c35bcc1186761496c4169d54ef6c2c925b9ad4fd47d9d47fc31ded2b9a50f6700f
6
+ metadata.gz: c9bd2c79639efc91ecb6baea6d2d071e37daaac742804ddb78bacde7cec940e144766db5e71f1cd2d6e6fc98f82dab45269483fc132b5302c7fd00f8567fefa2
7
+ data.tar.gz: 6facb02db12ddd4056d2199ad7100a3e6f007227ac5dd861357953442fa92b28d354dcf029e23485ac55aa005a0efd3043cbff9a6e1da9035ea3572858c24ea2
@@ -1,3 +1,3 @@
1
1
  module SfConnect
2
- VERSION = "0.2.2".freeze
2
+ VERSION = "0.2.3".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.3
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-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: restforce