peach-ruby 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/peach/stream/request.rb +9 -3
- data/lib/peach/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: 8a7f27b5b01c8b9ea55f876a6250f0c88eb475f5b420357a286a89cf8fa9482e
|
4
|
+
data.tar.gz: 59347383246e9ba8820d31fc97eed2f1a41c58fda460c540e00ea91d9a2fd5b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f82051293a16fdd61f4bc0b8d034e92eaed01f44fb0aa7dcaabc36db8f17b8e8af0c7c55092efe08fe24db6e1c3d9a3ed1ee9d85da7bdce31afdafcc5c0cbb5
|
7
|
+
data.tar.gz: b416cdc3ae802d1466a612e41f806407fe89597c3c113ca46b558e151abed10fce3eaaee7edf0f225cea8d59eef91b85a02722997f8fd3335b33f0b749f41b9a
|
data/lib/peach/stream/request.rb
CHANGED
@@ -3,11 +3,12 @@
|
|
3
3
|
module Peach
|
4
4
|
module Stream
|
5
5
|
class Request # :nodoc:
|
6
|
-
attr_reader :contact, :
|
6
|
+
attr_reader :contact, :params, :prompt, :message, :payload, :context
|
7
7
|
|
8
8
|
STREAM_TYPES = {
|
9
9
|
init: 'stream.init',
|
10
|
-
in_progress: 'stream.in_progress'
|
10
|
+
in_progress: 'stream.in_progress',
|
11
|
+
event_received: 'stream.event_received'
|
11
12
|
}.freeze
|
12
13
|
|
13
14
|
def initialize(raw_params)
|
@@ -24,6 +25,10 @@ module Peach
|
|
24
25
|
@type == STREAM_TYPES[:in_progress]
|
25
26
|
end
|
26
27
|
|
28
|
+
def event_received?
|
29
|
+
@type == STREAM_TYPES[:event_received]
|
30
|
+
end
|
31
|
+
|
27
32
|
private
|
28
33
|
|
29
34
|
def parse_params(raw_params)
|
@@ -46,9 +51,10 @@ module Peach
|
|
46
51
|
def instantiate_instance_variables_from(params)
|
47
52
|
@type = params[:type]
|
48
53
|
@contact = OpenStruct.new(params.dig(:request, :contact) || {})
|
49
|
-
@prompt = params.dig(:request, :prompt)
|
50
54
|
@params = params.dig(:request, :params) || {}
|
55
|
+
@prompt = params.dig(:request, :prompt)
|
51
56
|
@message = OpenStruct.new(params.dig(:request, :message) || {})
|
57
|
+
@payload = params.dig(:request, :payload) || {}
|
52
58
|
@context = params.dig(:request, :context) || {}
|
53
59
|
end
|
54
60
|
|
data/lib/peach/version.rb
CHANGED