sf_connect 0.2.0 → 0.2.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: ecdf868bd822337896493a4e44464be396451b14873f93252378a170c1dca5f5
4
- data.tar.gz: 23abb4b5437fe976c388871e0a0ba9a88451a84c9e69727cf303839e7c613e76
3
+ metadata.gz: cdab593ae705aa3e91a638d9d7679cd4f40c988b3d261242cf61f4ed20155d16
4
+ data.tar.gz: 97bd41340a528b7fbfac2125d7895f1c66bc3265f351e7dab738c08179468deb
5
5
  SHA512:
6
- metadata.gz: fac5c9cc89043d242166bdea4725c0bdba29519eb20e2b16fbac111eec86eae5ae43a483e67c49a9de4c938b15d0c90f317f47163be145ad8aa5e57fe2cf1318
7
- data.tar.gz: c5d8c8c6bdf7dbf2773145ee2b7d7c779a566c07fd0ebf2afad800edff2e9f259de8e6c745f61f7fc3bd67c301cc916ab7f744011740f274533e49b00003b8a3
6
+ metadata.gz: 3cd8e3776446c9fa0f4a077ecddc6940be8c3f3ffd65f5e5a03ed23f14c972d2da89747cfc7fc890deddeb3b317c193cc9b0ad59f75a4af3f2f30e5252831945
7
+ data.tar.gz: 1abf6aee240460bacac1304ca666cc924842fd5bde5ebe41302c6b9fa0d636c35bcc1186761496c4169d54ef6c2c925b9ad4fd47d9d47fc31ded2b9a50f6700f
@@ -35,9 +35,13 @@ module SfConnect
35
35
  record
36
36
  end
37
37
 
38
+ def import_records_for_salesforce(records)
39
+ upsert_all records
40
+ end
41
+
38
42
  def download_salesforce_records(batch_size = 1000)
39
43
  fetch_all.each_slice(batch_size) do |records|
40
- upsert_all records.map(&:for_download)
44
+ import_records_for_salesforce records.map(&:for_download)
41
45
  end
42
46
  end
43
47
  end
@@ -0,0 +1,12 @@
1
+ module SfConnect
2
+ # payload for salesforce
3
+ class Payload
4
+ attr_reader :record, :for_upload, :for_download
5
+
6
+ def initialize(record:, for_upload: nil, for_download: nil)
7
+ @record = record
8
+ @for_upload = for_upload
9
+ @for_download = for_download
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module SfConnect
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.2".freeze
3
3
  end
data/lib/sf_connect.rb CHANGED
@@ -7,13 +7,11 @@ require "active_support/all"
7
7
  module SfConnect
8
8
  extend ActiveSupport::Autoload
9
9
  autoload :Define
10
+ autoload :Payload
10
11
  autoload :Fields
11
12
  autoload :Uploader
12
13
  autoload :Downloader
13
14
 
14
- # upload and download payload
15
- Payload = Struct.new(:record, :for_upload, :for_download, keyword_init: true)
16
-
17
15
  class << self
18
16
  def define(salesforce_object_name, where: nil, **fields, &)
19
17
  SfConnect::Define.new(salesforce_object_name, where:, fields:, &).call
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sf_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masa (Aileron inc)
@@ -56,6 +56,7 @@ files:
56
56
  - lib/sf_connect/define.rb
57
57
  - lib/sf_connect/downloader.rb
58
58
  - lib/sf_connect/fields.rb
59
+ - lib/sf_connect/payload.rb
59
60
  - lib/sf_connect/uploader.rb
60
61
  - lib/sf_connect/version.rb
61
62
  - sig/sf_connect.rbs