Module: DjiMqttConnect::Mixins::ServicesOutputStatusChecks

Defined in:
lib/dji_mqtt_connect/mixins/services_output_status_checks.rb

Overview

Provides checks for the output object that contains a Types::ServicesOutputStatus status value

Instance Method Summary collapse

Instance Method Details

#humanized_statusObject



23
24
25
# File 'lib/dji_mqtt_connect/mixins/services_output_status_checks.rb', line 23

def humanized_status
  I18n.t(status, scope: "dji_mqtt_connect.services_output_status", default: status.titleize)
end

#status_finalized?Boolean Also known as: status_finalised?

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
20
# File 'lib/dji_mqtt_connect/mixins/services_output_status_checks.rb', line 12

def status_finalized?
  [
    Types::SERVICE_OUTPUT_STATUS_OK,
    Types::SERVICE_OUTPUT_STATUS_REJECTED,
    Types::SERVICE_OUTPUT_STATUS_FAILED,
    Types::SERVICE_OUTPUT_STATUS_CANCELED,
    Types::SERVICE_OUTPUT_STATUS_TIMEOUT
  ].include?(status)
end