Class: DjiMqttConnect::Thing::Product::EventsReplyMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/dji_mqtt_connect/messages/thing/product/events_reply_message.rb

Overview

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Message

current_timestamp, generate_bid, generate_tid, #to_s

Class Method Details

.build_for(events_message, result: 0) ⇒ Object

a result of 0 means we approve of this action



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/dji_mqtt_connect/messages/thing/product/events_reply_message.rb', line 8

def self.build_for(events_message, result: 0)
  new(
    _method: events_message._method,
    tid: events_message.tid,
    bid: events_message.bid,
    timestamp: current_timestamp,
    data: {
      result: result
    }
  )
end

Instance Method Details

#humanized_summaryObject



35
36
37
# File 'lib/dji_mqtt_connect/messages/thing/product/events_reply_message.rb', line 35

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

#humanized_summary_interpolationObject



39
40
41
# File 'lib/dji_mqtt_connect/messages/thing/product/events_reply_message.rb', line 39

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