Sha256: 57bf17ad146bc9ba0e1a6d16d55fcc64857bd913977ad21a44577a352e65d572

Contents?: true

Size: 745 Bytes

Versions: 2

Compression:

Stored size: 745 Bytes

Contents

# frozen_string_literal: true

module DjiMqttConnect
  module Thing::Product
    class ServicesMessage < DjiMqttConnect::Message
      # Ensure all values are accepted
      schema schema.strict

      attribute :tid, Types::UUID
      attribute :bid, Types::UUID
      attribute :timestamp, Types::Timestamp

      attribute :_method, Types::String

      attribute :data, Types::Hash.default({}.freeze)

      def humanized_summary
        Translations.thing_product_services_summary(_method, **humanized_summary_interpolation)
      end

      def humanized_summary_interpolation
        data.to_h.merge(method: _method)
      end

      # Returns all the flight IDs in the message
      def flight_ids
        []
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dji_mqtt_connect-0.1.25.1 lib/dji_mqtt_connect/messages/thing/product/services_message.rb
dji_mqtt_connect-0.1.25 lib/dji_mqtt_connect/messages/thing/product/services_message.rb