twi 0.3.5 → 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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/twi/conversation.rb +6 -3
- data/lib/twi/mock/conversation.rb +1 -2
- data/lib/twi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f766ffc7ee7dc2752c40e064832d07016e1622039a3b33c452540a541c92372
|
|
4
|
+
data.tar.gz: 5d80d22f39434d654325319b51e14ead96615dd0ce47854d12b374e1ac160ebf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 49839e92242ad8ca602bf0b0a227335b257eaf1ead198a43a258e6bb24fa32e0da814d07a4a346d4d8c90118a364fa53bb8a359c011a1d55895e10b3bf860fe8
|
|
7
|
+
data.tar.gz: dd399e942f3452016d9fcf06da3a69e876feba4c977c5b16342d0ea6db82f99f469da34ee2df0adac9843038def364e6a36f21df73486b761aeb3ede587dbab3
|
data/CHANGELOG.md
CHANGED
data/lib/twi/conversation.rb
CHANGED
|
@@ -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
|
-
@
|
|
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)
|
|
@@ -56,10 +55,14 @@ module Twi
|
|
|
56
55
|
JSON(response.body)['sid']
|
|
57
56
|
end
|
|
58
57
|
|
|
58
|
+
def id = @params[:id]
|
|
59
|
+
|
|
60
|
+
def status = @params[:status]
|
|
61
|
+
|
|
59
62
|
private
|
|
60
63
|
|
|
61
64
|
def conversation
|
|
62
|
-
conversation_service.conversations
|
|
65
|
+
conversation_service.conversations id
|
|
63
66
|
end
|
|
64
67
|
|
|
65
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
|
-
@
|
|
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