Sha256: b3025ca8da055c1e85187b50e3a846fbc3f66bab008ca96472775f2e612e5ae8

Contents?: true

Size: 1.95 KB

Versions: 61

Compression:

Stored size: 1.95 KB

Contents

# frozen_string_literal: true

module Cryptum
  # This plugin is used to Switch through Order Plan / Order History
  # Window Panes when the TAB Key is Pressed.
  module Event
    module Pane
      # Supported Method Parameters::
      # Cryptum::Event::Pane.switch(
      # )
      public_class_method def self.switch(opts = {})
        terminal_win = opts[:terminal_win]
        event_history = opts[:event_history]

        terminal_win.key_press_event.key_tab = false

        if event_history.order_plan_win_active
          event_history.order_plan_win_active = false
          event_history.order_execute_win_active = true
        else
          event_history.order_plan_win_active = true
          event_history.order_execute_win_active = false
        end
      rescue StandardError => e
        raise e
      end

      # Supported Method Parameters::
      # Cryptum::Event::Pane.toggle_details(
      # )
      public_class_method def self.toggle_details(opts = {})
        terminal_win = opts[:terminal_win]
        event_history = opts[:event_history]

        terminal_win.key_press_event.key_enter = false

        if event_history.order_plan_win_active
          unless event_history.red_pill
            if event_history.order_plan_details_win_active
              event_history.order_plan_details_win_active = false
            else
              event_history.order_plan_details_win_active = true
            end
          end
        elsif event_history.order_execute_win_active
          if event_history.order_execute_details_win_active
            event_history.order_execute_details_win_active = false
          else
            event_history.order_execute_details_win_active = true
          end
        end
      rescue StandardError => e
        raise e
      end

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

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
cryptum-0.0.341 lib/cryptum/event/pane.rb
cryptum-0.0.339 lib/cryptum/event/pane.rb
cryptum-0.0.338 lib/cryptum/event/pane.rb
cryptum-0.0.337 lib/cryptum/event/pane.rb
cryptum-0.0.336 lib/cryptum/event/pane.rb
cryptum-0.0.335 lib/cryptum/event/pane.rb
cryptum-0.0.334 lib/cryptum/event/pane.rb
cryptum-0.0.333 lib/cryptum/event/pane.rb
cryptum-0.0.332 lib/cryptum/event/pane.rb
cryptum-0.0.331 lib/cryptum/event/pane.rb
cryptum-0.0.330 lib/cryptum/event/pane.rb
cryptum-0.0.329 lib/cryptum/event/pane.rb
cryptum-0.0.328 lib/cryptum/event/pane.rb
cryptum-0.0.327 lib/cryptum/event/pane.rb
cryptum-0.0.326 lib/cryptum/event/pane.rb
cryptum-0.0.325 lib/cryptum/event/pane.rb
cryptum-0.0.324 lib/cryptum/event/pane.rb
cryptum-0.0.323 lib/cryptum/event/pane.rb
cryptum-0.0.322 lib/cryptum/event/pane.rb
cryptum-0.0.321 lib/cryptum/event/pane.rb