class MagLove::Commands::Base

Public Class Methods

new(args, opts, config) click to toggle source
Calls superclass method
# File lib/maglove/commands/base.rb, line 8
def initialize(args, opts, config)
  namespace = self.class.name.split("::").last.underscore
  command = config[:current_command].name
  Logging.mdc["full_command"] = "#{namespace}:#{command}"
  super
  theme.load(options.theme) if options.theme? and options.theme != theme.identifier
end

Private Instance Methods

magloft_api() click to toggle source
# File lib/maglove/commands/base.rb, line 22
def magloft_api
  @magloft_api ||= MagLoft::Api.client(options[:token])
end
reset_command_invocations(parent, *commands) click to toggle source
# File lib/maglove/commands/base.rb, line 30
def reset_command_invocations(parent, *commands)
  if commands.length.zero?
    @_invocations[parent] = []
  else
    commands.each do |command|
      @_invocations[parent].delete(command.to_s)
    end
  end
end
reset_invocations(*commands) click to toggle source
# File lib/maglove/commands/base.rb, line 26
def reset_invocations(*commands)
  reset_command_invocations(self.class, *commands)
end
theme() click to toggle source
# File lib/maglove/commands/base.rb, line 18
def theme
  Maglove.theme
end