Module: Campguide

Defined in:
lib/camping/campguide.rb

Overview

Campguide is a small helper to map common errors in a Camping project to a quick resolution.

Constant Summary collapse

Errors =
{"wrong number of arguments (given 3, expected 0)" => "ArgumentError. This is sometimes caused when you try to send a request to a controller when a camping app hasn't made camp yet. make certain to call Camping.make_camp to set up your apps."}

Class Method Summary collapse

Class Method Details

.make_sense(error_message) ⇒ Object

accepts string error messages and tries to match them with better explanations of the error.



8
9
10
11
# File 'lib/camping/campguide.rb', line 8

def make_sense(error_message)
	message = Errors[error_message]
	puts message ? message : error_message
end