# frozen_string_literal: true module DjiMqttConnect module Mixins # Provides checks for the event progress object that contains a Types::EventsProgressStepKey step_key value module EventsProgressChecks # Provide accessors for each step key value DjiMqttConnect::Types::EventsProgressStepKey.values.each do |step_key_value| define_method(:"#{step_key_value}_step?") { step_key == step_key_value } end def humanized_step_key return unless step_key I18n.t(step_key, scope: "dji_mqtt_connect.events_step_key", default: step_key.titleize) end end end end