module AWS::Core::LazyErrorClasses::ClassMethods
def const_missing(name)
def const_missing(name) base_error_grammar = self::BASE_ERROR_GRAMMAR const_missing_mutex.synchronize do return if const_defined?(name) const_set(name, Class.new(self::Base) do include Errors::ModeledError # so that MyService::Errors::Foo::Bar will work const_set(:BASE_ERROR_GRAMMAR, base_error_grammar) include LazyErrorClasses end) end end
def error_class(code)
def error_class(code) module_eval(code.gsub(".","::")) end
def included(mod)
def included(mod) raise NotImplementedError.new("#{self} lazy-generates error classes; "+ "therefore it is not suitable for "+ "inclusion in other modules") end