Class: AnswerLayer::StreamEvent
- Inherits:
-
Object
- Object
- AnswerLayer::StreamEvent
- Defined in:
- lib/answerlayer/responses/stream_event.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(type:, data:, raw: nil) ⇒ StreamEvent
constructor
A new instance of StreamEvent.
Constructor Details
#initialize(type:, data:, raw: nil) ⇒ StreamEvent
Returns a new instance of StreamEvent.
7 8 9 10 11 |
# File 'lib/answerlayer/responses/stream_event.rb', line 7 def initialize(type:, data:, raw: nil) @type = type.to_s @data = data @raw = raw end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/answerlayer/responses/stream_event.rb', line 5 def data @data end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/answerlayer/responses/stream_event.rb', line 5 def raw @raw end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/answerlayer/responses/stream_event.rb', line 5 def type @type end |
Instance Method Details
#error? ⇒ Boolean
13 14 15 |
# File 'lib/answerlayer/responses/stream_event.rb', line 13 def error? type == "error" end |