zoho_hub 0.1.42 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f1601f1a294e6f0b98e4fa8f4f67721555969c8fc68493631aadd3d8725d28b
4
- data.tar.gz: 62caa28fd2764e06dc64fd36122659bf820be136e052bd410baa511d6805b70b
3
+ metadata.gz: c285a9ec2a9801b3bec2c31939dc4beae0b8609a5f7c580b83ca10370602aaaa
4
+ data.tar.gz: e4a038822683ee471bca12920bb1f25212ef9ada0de6622b9e2eb7173f674166
5
5
  SHA512:
6
- metadata.gz: b29b6fd25fc0c1cf3ec8641af851883bb73d6d9f802cac01e22f26773f18640489eb56d127d4c8b629be17537c9bffe623980521b1d5f3eb19e8d2d379ef6324
7
- data.tar.gz: 91ef51fabb4895e4a2585f8077caa583c140d74815c692167620633d6ba3e54ee5ea51909ee47be3546ef682411dbc3897bd30db71e2ee9ddad81d0587069d10
6
+ metadata.gz: 92c8d04ab630de0fd839c448145c15c07edca559ea204a05c9e69bf81b58fd1f7f438e8f66c71a50eadd575355d8b08db085da7adf118cd2cbe0f9405f288908
7
+ data.tar.gz: 164bdad2a96114ce70e3b9a1a0efb7fe1653919bd84230a7c3be3ade9fd960d33b72b3fdf824a8f60688febc5b63f6f72733a51b5bffdbb3c17bace6e79470a1
@@ -11,8 +11,6 @@ module ZohoHub
11
11
  )
12
12
 
13
13
  def initialize(params)
14
- puts Rainbow(params).magenta
15
-
16
14
  attributes.each do |attr|
17
15
  zoho_key = attr_to_zoho_key(attr)
18
16
 
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'zoho_hub/records/base_record'
4
+
5
+ module ZohoHub
6
+ class SMSMessage < BaseRecord
7
+ attributes :id, :template, :state, :text, :contact_id, :potential_id, :name
8
+
9
+ attribute_translation id: :id
10
+
11
+ def initialize(params)
12
+ attributes.each do |attr|
13
+ zoho_key = attr_to_zoho_key(attr)
14
+
15
+ send("#{attr}=", params[zoho_key] || params[attr])
16
+ end
17
+
18
+ # Setup values as they come from the Zoho API if needed
19
+ @contact_id ||= params.dig(:Contact, :id)
20
+ @potential_id ||= params.dig(:Potential, :id)
21
+ end
22
+
23
+ def to_params
24
+ params = super
25
+
26
+ params[:Contact] = { id: @contact_id } if @contact_id
27
+ params[:Potential] = { id: @potential_id } if @potential_id
28
+
29
+ params
30
+ end
31
+ end
32
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZohoHub
4
- VERSION = '0.1.42'
4
+ VERSION = '0.1.43'
5
5
  end
data/lib/zoho_hub.rb CHANGED
@@ -18,6 +18,7 @@ require 'zoho_hub/records/product'
18
18
  require 'zoho_hub/records/attachment'
19
19
  require 'zoho_hub/records/credit_score'
20
20
  require 'zoho_hub/records/adverse_criteria'
21
+ require 'zoho_hub/records/sms_message'
21
22
 
22
23
  module ZohoHub
23
24
  module_function
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoho_hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.42
4
+ version: 0.1.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Otero
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-17 00:00:00.000000000 Z
11
+ date: 2022-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -239,6 +239,7 @@ files:
239
239
  - lib/zoho_hub/records/potential.rb
240
240
  - lib/zoho_hub/records/product.rb
241
241
  - lib/zoho_hub/records/quote.rb
242
+ - lib/zoho_hub/records/sms_message.rb
242
243
  - lib/zoho_hub/records/vendor.rb
243
244
  - lib/zoho_hub/response.rb
244
245
  - lib/zoho_hub/version.rb