Sha256: 29b9064cfa9c42ffea76cf720cd9ad12869e710dc1e6dad40149b4c0c89550eb

Contents?: true

Size: 804 Bytes

Versions: 9

Compression:

Stored size: 804 Bytes

Contents

class Syncano
  module Packets
    # Class representing message packets used in communication with the Sync Server
    class Message < Syncano::Packets::Base
      attr_accessor :id, :source, :target, :data

      # Constructor for Syncano::Packets::Message object
      # @param [Hash] attributes
      def initialize(attributes)
        super(attributes)
        self.id = attributes[:id]
        self.source = attributes[:source]
        self.target = attributes[:target]
        self.data = attributes[:data]
      end

      # Returns true if is a notification packet
      # @return [TrueClass, FalseClass]
      def notification?
        true
      end

      # Returns true if is a message packet
      # @return [TrueClass, FalseClass]
      def message?
        true
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
syncano-3.1.4 lib/syncano/packets/message.rb
syncano-3.1.3 lib/syncano/packets/message.rb
syncano-3.1.2 lib/syncano/packets/message.rb
syncano-3.1.1 lib/syncano/packets/message.rb
syncano-3.1.1.beta5 lib/syncano/packets/message.rb
syncano-3.1.1.beta4 lib/syncano/packets/message.rb
syncano-3.1.1.beta3 lib/syncano/packets/message.rb
syncano-3.1.1.beta2 lib/syncano/packets/message.rb
syncano-3.1.1.beta lib/syncano/packets/message.rb