Sha256: 6e42ab468ef02fa2f7ad8db72d4774303bbc9d1baa59449e117818ef091d69d7

Contents?: true

Size: 912 Bytes

Versions: 111

Compression:

Stored size: 912 Bytes

Contents

# frozen_string_literal: true

module Cryptum
  # This plugin is used to Exit Cryptum Gracefully When the "x" Key is Pressed
  module Event
    module Exit
      # Supported Method Parameters::
      # Cryptum::Event::BotConf.gracefully(
      # )
      public_class_method def self.gracefully(opts = {})
        terminal_win = opts[:terminal_win]
        event_history = opts[:event_history]
        option_choice = opts[:option_choice]
        env = opts[:env]

        terminal_win.key_press_event.key_x = false
        Cryptum.exit_gracefully(
          which_self: self,
          event_history: event_history,
          option_choice: option_choice,
          env: env
        )
      rescue StandardError => e
        raise e
      end

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

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
cryptum-0.0.381 lib/cryptum/event/exit.rb
cryptum-0.0.380 lib/cryptum/event/exit.rb
cryptum-0.0.379 lib/cryptum/event/exit.rb
cryptum-0.0.378 lib/cryptum/event/exit.rb
cryptum-0.0.377 lib/cryptum/event/exit.rb
cryptum-0.0.376 lib/cryptum/event/exit.rb
cryptum-0.0.375 lib/cryptum/event/exit.rb
cryptum-0.0.374 lib/cryptum/event/exit.rb
cryptum-0.0.373 lib/cryptum/event/exit.rb
cryptum-0.0.372 lib/cryptum/event/exit.rb
cryptum-0.0.370 lib/cryptum/event/exit.rb
cryptum-0.0.369 lib/cryptum/event/exit.rb
cryptum-0.0.368 lib/cryptum/event/exit.rb
cryptum-0.0.367 lib/cryptum/event/exit.rb
cryptum-0.0.366 lib/cryptum/event/exit.rb
cryptum-0.0.365 lib/cryptum/event/exit.rb
cryptum-0.0.364 lib/cryptum/event/exit.rb
cryptum-0.0.363 lib/cryptum/event/exit.rb
cryptum-0.0.362 lib/cryptum/event/exit.rb
cryptum-0.0.361 lib/cryptum/event/exit.rb