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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 557e13610afe3709ca022ada06e2bcf2ed02ad9b6da78023fd08c5a4d6fdf47a
4
- data.tar.gz: 5d5035d2b1015a81489b061a40597d6285d601c11e0774610ecb8b5efbe0f684
3
+ metadata.gz: 8a7f27b5b01c8b9ea55f876a6250f0c88eb475f5b420357a286a89cf8fa9482e
4
+ data.tar.gz: 59347383246e9ba8820d31fc97eed2f1a41c58fda460c540e00ea91d9a2fd5b6
5
5
  SHA512:
6
- metadata.gz: c517fe6adc838a1996438b5026f0694316081c26811b7afd3316df50e4e22ef55437ad200c7d3df0efb30fc70a22778fb1b81011e44a412db09428275ad15a1a
7
- data.tar.gz: 8d205177f57f5776664d0923b297275aebfcec11769b971ab3294c470a2e523d6820903b086db0965ffa7384ff54defe24e71c89a33854032095a55919014328
6
+ metadata.gz: 7f82051293a16fdd61f4bc0b8d034e92eaed01f44fb0aa7dcaabc36db8f17b8e8af0c7c55092efe08fe24db6e1c3d9a3ed1ee9d85da7bdce31afdafcc5c0cbb5
7
+ data.tar.gz: b416cdc3ae802d1466a612e41f806407fe89597c3c113ca46b558e151abed10fce3eaaee7edf0f225cea8d59eef91b85a02722997f8fd3335b33f0b749f41b9a
@@ -3,11 +3,12 @@
3
3
  module Peach
4
4
  module Stream
5
5
  class Request # :nodoc:
6
- attr_reader :contact, :prompt, :params, :message, :context
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Peach
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peach-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peach Developers