Sha256: f0a701fdcd15f82cfaaa948998f19c8c8d661bcd1f0f0d255752864e058b9b9f

Contents?: true

Size: 913 Bytes

Versions: 69

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true

module Cryptum
  # Cryptum::Event Namespace
  module Event
    # This Module is used to Cancel Open Orders When the "C" Key is Pressed
    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

69 entries across 69 versions & 1 rubygems

Version Path
cryptum-0.0.466 lib/cryptum/event/cancel.rb
cryptum-0.0.465 lib/cryptum/event/cancel.rb
cryptum-0.0.464 lib/cryptum/event/cancel.rb
cryptum-0.0.463 lib/cryptum/event/cancel.rb
cryptum-0.0.462 lib/cryptum/event/cancel.rb
cryptum-0.0.461 lib/cryptum/event/cancel.rb
cryptum-0.0.460 lib/cryptum/event/cancel.rb
cryptum-0.0.459 lib/cryptum/event/cancel.rb
cryptum-0.0.458 lib/cryptum/event/cancel.rb
cryptum-0.0.457 lib/cryptum/event/cancel.rb
cryptum-0.0.456 lib/cryptum/event/cancel.rb
cryptum-0.0.455 lib/cryptum/event/cancel.rb
cryptum-0.0.454 lib/cryptum/event/cancel.rb
cryptum-0.0.453 lib/cryptum/event/cancel.rb
cryptum-0.0.452 lib/cryptum/event/cancel.rb
cryptum-0.0.451 lib/cryptum/event/cancel.rb
cryptum-0.0.450 lib/cryptum/event/cancel.rb
cryptum-0.0.449 lib/cryptum/event/cancel.rb
cryptum-0.0.448 lib/cryptum/event/cancel.rb
cryptum-0.0.447 lib/cryptum/event/cancel.rb