Class: DJI::Command::FedexCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/dji/commands/fedex/fedex_command.rb

Instance Method Summary collapse

Methods inherited from Base

command_name, inherited, namespace, perform

Instance Method Details

#fedexObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dji/commands/fedex/fedex_command.rb', line 10

def fedex
  if options[:repeat].present?
    interval = options[:repeat].to_i.presence || 300
    puts
    puts "Requesting FedEx tracking by reference #{options[:reference]} every #{interval} seconds. Press CONTROL-C to stop..."

    while true
      DJI::Fedex.track_by_reference(options[:country_code], options[:postal_code], options[:reference])
      sleep(interval)
    end
  else
    DJI::Fedex.track_by_reference(options[:country_code], options[:postal_code], options[:reference])
  end
end