Class: Syncano::Packets::Message
- Defined in:
- lib/syncano/packets/message.rb
Overview
Class representing message packets used in communication with the Sync Server
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#id ⇒ Object
Returns the value of attribute id.
-
#source ⇒ Object
Returns the value of attribute source.
-
#target ⇒ Object
Returns the value of attribute target.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Message
constructor
Constructor for Syncano::Packets::Message object.
-
#message? ⇒ TrueClass, FalseClass
Returns true if is a message packet.
-
#notification? ⇒ TrueClass, FalseClass
Returns true if is a notification packet.
Methods inherited from Base
#auth?, #call_response?, instantize_packet, #ping?
Constructor Details
#initialize(attributes) ⇒ Message
Constructor for Syncano::Packets::Message object
9 10 11 12 13 14 15 |
# File 'lib/syncano/packets/message.rb', line 9 def initialize(attributes) super(attributes) self.id = attributes[:id] self.source = attributes[:source] self.target = attributes[:target] self.data = attributes[:data] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/syncano/packets/message.rb', line 5 def data @data end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/syncano/packets/message.rb', line 5 def id @id end |
#source ⇒ Object
Returns the value of attribute source.
5 6 7 |
# File 'lib/syncano/packets/message.rb', line 5 def source @source end |
#target ⇒ Object
Returns the value of attribute target.
5 6 7 |
# File 'lib/syncano/packets/message.rb', line 5 def target @target end |
Instance Method Details
#message? ⇒ TrueClass, FalseClass
Returns true if is a message packet
25 26 27 |
# File 'lib/syncano/packets/message.rb', line 25 def true end |
#notification? ⇒ TrueClass, FalseClass
Returns true if is a notification packet
19 20 21 |
# File 'lib/syncano/packets/message.rb', line 19 def notification? true end |