Class: Request::Base::Event
- Inherits:
-
Object
- Object
- Request::Base::Event
- Defined in:
- lib/violet/request.rb
Overview
superclass of message send to Violet.
Direct Known Subclasses
Action, AudioStream, EventCollection, Choregraphy, IdMessage, SetEarsPosition, TtsMessage
Instance Method Summary collapse
-
#+(other) ⇒ Object
it’s possible to send multiples events on a single request.
-
#initialize ⇒ Event
constructor
constructor has to be overrided.
-
#streamed? ⇒ Boolean
return
true
if self is a Stream Event (that use APISTREAM_URL instead of API_URL),false
otherwise. -
#to_url ⇒ Object
to_url has to be overrided.
Constructor Details
#initialize ⇒ Event
constructor has to be overrided
31 32 33 |
# File 'lib/violet/request.rb', line 31 def initialize raise NotImplementedError end |
Instance Method Details
#+(other) ⇒ Object
it’s possible to send multiples events on a single request. this method return a new EventCollection object, that cotains self
and other
.
37 38 39 40 |
# File 'lib/violet/request.rb', line 37 def + other raise ArgumentError.new("#{other.inspect} is a Streamed Event") if other.streamed? EventCollection.new self, other end |
#streamed? ⇒ Boolean
return true
if self is a Stream Event (that use APISTREAM_URL instead of API_URL), false
otherwise.
48 49 50 |
# File 'lib/violet/request.rb', line 48 def streamed? self.class.to_s =~ /Stream$/ end |
#to_url ⇒ Object
to_url has to be overrided
43 44 45 |
# File 'lib/violet/request.rb', line 43 def to_url raise NotImplementedError end |