Sha256: 0267d2a2ec3b8de78602a1c5e2529289077d5216e17f38da7f7b68d1ee204ee7

Contents?: true

Size: 623 Bytes

Versions: 23

Compression:

Stored size: 623 Bytes

Contents

# 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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
dji_mqtt_connect-0.1.25.1 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.25 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.24.1 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.24 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.23.3 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.23.2 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.23.1 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.23 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.22.2 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.22.1 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.22 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.21 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.20.1 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.20 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.19.2 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.19.1 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.19 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.18 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.17.1 lib/dji_mqtt_connect/mixins/events_progress_checks.rb
dji_mqtt_connect-0.1.17 lib/dji_mqtt_connect/mixins/events_progress_checks.rb