Sha256: 2d0037d47a200b70346b53f7ac7c99cde041386981273e16384dd09713f5664e

Contents?: true

Size: 616 Bytes

Versions: 1

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true

require "open3"
require "io/wait"

module Textbringer
  module Commands
    include Utils

    @@command_list = []

    def self.list
      @@command_list
    end

    def define_command(name, &block)
      Commands.send(:define_method, name, &block)
      @@command_list << name if !@@command_list.include?(name)
      name
    end
    module_function :define_command

    def undefine_command(name)
      if @@command_list.include?(name)
        Commands.send(:undef_method, name)
        @@command_list.delete(name)
      end
    end
    module_function :undefine_command
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
textbringer-0.1.8 lib/textbringer/commands.rb