Sha256: 1f7453d74b270890a39e5dbadb6ba3fb2b42381f925e76d96b09b01365e4cd32

Contents?: true

Size: 883 Bytes

Versions: 9

Compression:

Stored size: 883 Bytes

Contents

# frozen_string_literal: true

module Cryptum
  # This plugin is used to Reload the Bot Conf When the "C" Key is Pressed
  module Event
    module Cancel
      # Supported Method Parameters::
      # Cryptum::Event::Cancel.open_orders(
      # )
      public_class_method def self.open_orders(opts = {})
        terminal_win = opts[:terminal_win]
        option_choice = opts[:option_choice]
        env = opts[:env]

        terminal_win.key_press_event.key_c = false
        Cryptum::API::Orders.cancel_all_open_orders(
          env: env,
          option_choice: option_choice
        )
      rescue Interrupt, StandardError => e
        Cryptum::Log.append(level: :error, msg: e, which_self: self)
      end

      # Display Usage for this Module
      public_class_method def self.help
        puts "USAGE:
          #{self}.open_orders()
        "
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cryptum-0.0.397 lib/cryptum/event/cancel.rb
cryptum-0.0.396 lib/cryptum/event/cancel.rb
cryptum-0.0.395 lib/cryptum/event/cancel.rb
cryptum-0.0.394 lib/cryptum/event/cancel.rb
cryptum-0.0.393 lib/cryptum/event/cancel.rb
cryptum-0.0.392 lib/cryptum/event/cancel.rb
cryptum-0.0.389 lib/cryptum/event/cancel.rb
cryptum-0.0.388 lib/cryptum/event/cancel.rb
cryptum-0.0.387 lib/cryptum/event/cancel.rb