Sha256: 4b4b7e6b0d05aa23a50d4ec83c4a7e3f43d038133216deed8cb23cee28dbe63e
Contents?: true
Size: 947 Bytes
Versions: 23
Compression:
Stored size: 947 Bytes
Contents
# frozen_string_literal: true module DjiMqttConnect module Mixins # Provides checks for the output object that contains a Types::ServicesOutputStatus status value module ServicesOutputStatusChecks # Provide accessors for each status value DjiMqttConnect::Types::ServicesOutputStatus.values.each do |status_value| define_method(:"status_#{status_value}?") { status == status_value } end 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 alias_method :status_finalised?, :status_finalized? def humanized_status I18n.t(status, scope: "dji_mqtt_connect.services_output_status", default: status.titleize) end end end end
Version data entries
23 entries across 23 versions & 1 rubygems