Exception: Commandable::MissingRequiredParameterError

Inherits:
ScriptError
  • Object
show all
Defined in:
lib/commandable/exceptions.rb

Overview

An error raised if a user does not provide a required command

Instance Method Summary collapse

Constructor Details

#initialize(msg) ⇒ MissingRequiredParameterError

Create a new instance of the MissingRequiredParameterError class



45
46
47
48
49
50
# File 'lib/commandable/exceptions.rb', line 45

def initialize(msg)
  super("""
  The #{"default " if msg[:default]}command \"#{msg[:method]}\" is missing the required parameter \"#{msg[:parameters]}\".
  #{"You don't have to specifically say \"#{msg[:method]}\" but you do have to give the parameter." if msg[:default]}"
  )
end

Instance Method Details

#friendly_nameObject

Returns a more print friendly error name



41
42
43
# File 'lib/commandable/exceptions.rb', line 41

def friendly_name
  "Missing Required Parmeter"
end