Class: Peach::Stream::Request
- Inherits:
-
Object
- Object
- Peach::Stream::Request
- Defined in:
- lib/peach/stream/request.rb
Overview
:nodoc:
Constant Summary collapse
- STREAM_TYPES =
{ init: 'stream.init', in_progress: 'stream.in_progress', event_received: 'stream.event_received' }.freeze
Instance Attribute Summary collapse
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
Instance Method Summary collapse
- #event_received? ⇒ Boolean
- #in_progress? ⇒ Boolean
- #init? ⇒ Boolean
-
#initialize(raw_params) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(raw_params) ⇒ Request
Returns a new instance of Request.
14 15 16 17 18 |
# File 'lib/peach/stream/request.rb', line 14 def initialize(raw_params) params = parse_params raw_params validate_params params instantiate_instance_variables_from params end |
Instance Attribute Details
#contact ⇒ Object (readonly)
Returns the value of attribute contact.
6 7 8 |
# File 'lib/peach/stream/request.rb', line 6 def contact @contact end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/peach/stream/request.rb', line 6 def context @context end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/peach/stream/request.rb', line 6 def @message end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/peach/stream/request.rb', line 6 def params @params end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
6 7 8 |
# File 'lib/peach/stream/request.rb', line 6 def payload @payload end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
6 7 8 |
# File 'lib/peach/stream/request.rb', line 6 def prompt @prompt end |
Instance Method Details
#event_received? ⇒ Boolean
28 29 30 |
# File 'lib/peach/stream/request.rb', line 28 def event_received? @type == STREAM_TYPES[:event_received] end |
#in_progress? ⇒ Boolean
24 25 26 |
# File 'lib/peach/stream/request.rb', line 24 def in_progress? @type == STREAM_TYPES[:in_progress] end |
#init? ⇒ Boolean
20 21 22 |
# File 'lib/peach/stream/request.rb', line 20 def init? @type == STREAM_TYPES[:init] end |