Method: MotherBrain::Mixin::CodedExit::ClassMethods#exit_code_for

Defined in:
lib/mb/mixin/coded_exit.rb

#exit_code_for(const_name) ⇒ Integer Also known as: exit_status_for

Look up the exit status for motherbrain error matching the given name

Examples:

retrieving the exit status for MB::InvalidConfig

exit_code_for("InvalidConfig") #=> 14

Parameters:

  • const_name (String)

    name of the error constant to lookup

Returns:

  • (Integer)


42
43
44
# File 'lib/mb/mixin/coded_exit.rb', line 42

def exit_code_for(const_name)
  MB.const_get(const_name).exit_code
end