Module: RJR::Errors

Defined in:
lib/rjr/errors.rb

Overview

The RJR::Errors module provides a mechanism to dynamically create errors on demand as they are needed. At some point this will go away / be replaced with a more rigidly / fixed defined error heirarchy.

Class Method Summary collapse

Class Method Details

.const_missing(error_name) ⇒ Object

Catches all Errors constants and define new RuntimeError subclass



14
15
16
17
18
19
20
# File 'lib/rjr/errors.rb', line 14

def self.const_missing(error_name)  # :nodoc:
  if error_name.to_s =~ /Error\z/
    const_set(error_name, Class.new(RuntimeError))
  else
    super
  end
end