Sha256: 9d3fbb36d13feb5d15f66a91f4e8e6b5ecae5d26f5925da4400a6adc03ad442e

Contents?: true

Size: 678 Bytes

Versions: 28

Compression:

Stored size: 678 Bytes

Contents

# frozen_string_literal: true

module DjiMqttConnect
  module Thing::Product
    class EventsMessage < Message
      attribute :bid, Types::UUID
      attribute :tid, Types::UUID
      attribute :timestamp, Types::Timestamp

      # NOTE: Included in most events messages, requires a reply on the events_reply topic if true
      attribute? :need_reply, Types::Integer.enum(0, 1)

      attribute :_data, Types::Hash
      attribute :_method, Types::String

      def need_reply?
        need_reply == 1
      end

      def to_s
        # Include data method for Generic messages
        instance_of?(EventsMessage) ? "#{super}[#{_method}]" : super
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
dji_mqtt_connect-0.1.24.1 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.24 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.23.3 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.23.2 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.23.1 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.23 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.22.2 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.22.1 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.22 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.21 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.20.1 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.20 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.19.2 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.19.1 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.19 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.18 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.17.1 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.17 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.16.2 lib/dji_mqtt_connect/messages/thing/product/events_message.rb
dji_mqtt_connect-0.1.16.1 lib/dji_mqtt_connect/messages/thing/product/events_message.rb