Module: DjiMqttConnect::Mixins::PutterState
- Defined in:
- lib/dji_mqtt_connect/mixins/putter_state.rb
Instance Method Summary collapse
Instance Method Details
#humanized_putter_state ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dji_mqtt_connect/mixins/putter_state.rb', line 6 def humanized_putter_state return unless putter_state state_key = case putter_state when Types::PUTTER_STATE_CLOSED "Closed" when Types::PUTTER_STATE_OPEN "Open" when Types::PUTTER_STATE_HALF_OPEN "Half-open" when Types::PUTTER_STATE_ABNORMAL "Abnormal" end I18n.t(state_key.parameterize.underscore, scope: "dji_mqtt_connect.dock_putter_state", default: state_key) end |