Class: Mooncell::CLI::Commands::Base Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mooncell/cli/commands/base.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Base class for commands

Since:

  • 0.1.0

Direct Known Subclasses

Console, Server, Version

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.inherited(base) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



25
26
27
28
29
30
31
32
# File 'lib/mooncell/cli/commands/base.rb', line 25

def inherited(base)
  super
  base.class_eval do
    @_requirements = Concurrent::Array.new
    extend ClassMethods
    prepend InstanceMethods
  end
end

.register(name, command = nil, aliases: [], app_only: false, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

rubocop:disable Metrics/LineLength

Since:

  • 0.1.0



18
19
20
# File 'lib/mooncell/cli/commands/base.rb', line 18

def register(name, command = nil, aliases: [], app_only: false, &block)
  Registry.add(name, command, aliases: aliases, app_only: app_only, &block)
end