twi 0.3.4 → 0.3.6

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: 6e8f3fca6e42b3f731d96f1f5ed8c8a8227b3cdfddd67ab208f1617b611ddec8
4
- data.tar.gz: 31275ab88e2107cfc15dcbaa764f793a06858a546f67ceead7bb6247808038ab
3
+ metadata.gz: 8f766ffc7ee7dc2752c40e064832d07016e1622039a3b33c452540a541c92372
4
+ data.tar.gz: 5d80d22f39434d654325319b51e14ead96615dd0ce47854d12b374e1ac160ebf
5
5
  SHA512:
6
- metadata.gz: 490faad79c0c998c04523a92cd8438f9adea3caf1e1e5f7efd0afc711e1e5275f7fae463b4736bd4d3218624f7838665ae68002aad33fc80cf25ef436d0d0770
7
- data.tar.gz: faf28b58e820cfff88c68cc9b504a2b6a343a928be4996b3981709f63fd17dcc736ad8ad3a32f816a8604440bce1d52621c50e05a934632c12b1bfa6ef300e31
6
+ metadata.gz: 49839e92242ad8ca602bf0b0a227335b257eaf1ead198a43a258e6bb24fa32e0da814d07a4a346d4d8c90118a364fa53bb8a359c011a1d55895e10b3bf860fe8
7
+ data.tar.gz: dd399e942f3452016d9fcf06da3a69e876feba4c977c5b16342d0ea6db82f99f469da34ee2df0adac9843038def364e6a36f21df73486b761aeb3ede587dbab3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.3.6] - 2026-06-01
2
+
3
+ - [Fix] Expose Twi::Conversation#id and #status
4
+
5
+ ## [0.3.5] - 2026-06-01
6
+
7
+ - [Fix] Ignore 404 on conversation.delete
8
+
1
9
  ## [0.3.4] - 2026-06-01
2
10
 
3
11
  - [Fix] Fix params of Twi::Error
@@ -8,8 +8,7 @@ module Twi
8
8
  params = create_params_for participants
9
9
  conversation = conversation_service.conversation_with_participants.create **params
10
10
 
11
- @id = conversation.sid
12
- @status = conversation.state
11
+ @params = { id: conversation.sid, status: conversation.state }
13
12
  rescue Twilio::REST::RestError => error
14
13
  case error.code
15
14
  when 50438 then raise ExistingConversationError.new(code: error.code, message: error.error_message)
@@ -28,6 +27,8 @@ module Twi
28
27
 
29
28
  def delete
30
29
  conversation.delete
30
+ rescue Twilio::REST::RestError => error
31
+ raise unless error.code == 20404
31
32
  end
32
33
 
33
34
  def url
@@ -54,10 +55,14 @@ module Twi
54
55
  JSON(response.body)['sid']
55
56
  end
56
57
 
58
+ def id = @params[:id]
59
+
60
+ def status = @params[:status]
61
+
57
62
  private
58
63
 
59
64
  def conversation
60
- conversation_service.conversations @params[:id]
65
+ conversation_service.conversations id
61
66
  end
62
67
 
63
68
  def create_params_for(participants)
@@ -8,8 +8,7 @@ module Twi
8
8
  when 50214 then raise TooManyConversationsError.new(error)
9
9
  end
10
10
  elsif Twi.mock.conversation
11
- @id = Twi.mock.conversation[:id]
12
- @status = Twi.mock.conversation[:status]
11
+ @params = { id: Twi.mock.conversation[:id], status: Twi.mock.conversation[:status] }
13
12
  end
14
13
  end
15
14
 
data/lib/twi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Twi
4
- VERSION = '0.3.4'
4
+ VERSION = '0.3.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo