Class: DJI::Command::TrackCommand
- Defined in:
- lib/dji/commands/track/track_command.rb
Instance Method Summary collapse
Methods inherited from Base
command_name, inherited, namespace, perform
Instance Method Details
#track ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/dji/commands/track/track_command.rb', line 19 def track order_time = Time.parse([:order_time]) if [:order_time].present? = { order_number: [:order_number], order_time: order_time, phone_tail: [:phone_tail], country: [:country], debug: [:debug], dji_username: [:dji_username], email_address: [:email_address], } if [:repeat].present? interval = [:repeat].to_i.presence || 300 puts puts "Requesting order tracking details every #{interval} seconds. Press CONTROL-C to stop..." while true data = DJI::OrderTracking.tracking_details() DJI::OrderTracking.publish(data) if data.present? && [:publish].present? sleep(interval) end else data = DJI::OrderTracking.tracking_details() DJI::OrderTracking.publish(data) if data.present? && [:publish].present? end end |