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
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/dji/commands/track/track_command.rb', line 10 def track 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([:order_number], [:phone_tail]) DJI::OrderTracking.publish(data) if data.present? && [:publish].present? sleep(interval) end else data = DJI::OrderTracking.tracking_details([:order_number], [:phone_tail]) DJI::OrderTracking.publish(data) if data.present? && [:publish].present? end end |