lib/ig_markets/cli/main.rb
def report_deal_confirmation(deal_reference)
          puts "Deal reference: #{deal_reference}"

          5.times do |index|
            return print_deal_confirmation @dealing_platform.deal_confirmation(deal_reference)
          rescue Errors::DealNotFoundError
            raise if index == 4

            puts 'Deal not found, retrying ...'
            sleep 2
          end
        end
# Requests and displays the deal confirmation for the passed deal reference. If the request for the deal
# confirmation returns a 'deal not found' error then the request is attempted again after a two second pause.
# This is done because sometimes there is a delay in the processing of the deal by IG Markets. A maximum of
# five attempts wil be made before failing outright.
#
# @param [String] deal_reference The deal reference.
Requests and displays the deal confirmation for the passed deal reference. If the request for the deal
confirmation returns a 'deal not found' error then the request is attempted again after a two second pause.
This is done because sometimes there is a delay in the processing of the deal by IG Markets. A maximum of
five attempts wil be made before failing outright.
Requests and displays the deal confirmation for the passed deal reference . If the request for the deal confirmation returns a ' deal not found ' error then the request is attempted again after a two second pause . This is done because sometimes there is a delay in the processing of the deal by IG Markets . A maximum of five attempts wil be made before failing outright .
def report_deal_confirmation(deal_reference)
          puts "Deal reference: #{deal_reference}"
          5.times do |index|
            return print_deal_confirmation @dealing_platform.deal_confirmation(deal_reference)
          rescue Errors::DealNotFoundError
            raise if index == 4
            puts 'Deal not found, retrying ...'
            sleep 2
          end
        end
def report_deal_confirmation ( deal_reference ) puts "Deal reference: #{deal_reference}" 5 . times do | index | return print_deal_confirmation @dealing_platform . deal_confirmation ( deal_reference ) rescue Errors :: DealNotFoundError raise if index == 4 puts 'Deal not found, retrying ...' sleep 2 end end
Requests and displays the deal confirmation for the passed deal reference.
Requests and displays the deal confirmation for the passed deal reference .
deal_reference
deal_reference The deal reference.
deal_reference The deal reference .