lib/ig_markets/cli/main.rb
# Signs in to IG Markets and yields back a {DealingPlatform} instance, with common error handling if exceptions
# occur. This method is used by all of the commands in order to authenticate.
#
# @param [Thor::CoreExt::HashWithIndifferentAccess] options The Thor options hash.
Signs in to IG Markets and yields back a {DealingPlatform} instance, with common error handling if exceptions
occur. This method is used by all of the commands in order to authenticate.
Signs in to IG Markets and yields back a { DealingPlatform } instance with common error handling if exceptions occur . This method is used by all of the commands in order to authenticate .
def begin_session(options)
          platform = options[:demo] ? :demo : :live
          @dealing_platform ||= DealingPlatform.new
          @dealing_platform.session.log_sinks = [$stdout] if options[:verbose]
          @dealing_platform.sign_in options[:username], options[:password], options[:api_key], platform
          yield @dealing_platform
        rescue IGMarketsError => e
          warn_and_exit e
        end
def begin_session ( options ) platform = options [ :demo ] ? :demo : :live @dealing_platform ||= DealingPlatform . new @dealing_platform . session . log_sinks = [ $stdout ] if options [ :verbose ] @dealing_platform . sign_in options [ :username ] , options [ :password ] , options [ :api_key ] , platform yield @dealing_platform rescue IGMarketsError => e warn_and_exit e end
Signs in to IG Markets and yields back a {DealingPlatform} instance, with common error handling if exceptions
occur.
Signs in to IG Markets and yields back a { DealingPlatform } instance with common error handling if exceptions occur .
options
options The Thor options hash.
options The Thor options hash .