module AWS::Core::LazyErrorClasses::ClassMethods

@private

Public Instance Methods

const_missing(name) click to toggle source
# File lib/aws/core/lazy_error_classes.rb, line 25
def const_missing(name)
  base_error_grammar = self::BASE_ERROR_GRAMMAR
  mod = self::ERROR_MODULE
  const_missing_mutex.synchronize do
    const_set(name,
              Class.new(self::Base) do
                include mod::ModeledError

                # so that MyService::Errors::Foo::Bar will work
                const_set(:BASE_ERROR_GRAMMAR, base_error_grammar)
                const_set(:ERROR_MODULE, mod)
                include LazyErrorClasses
              end)
  end
end
error_class(code) click to toggle source
# File lib/aws/core/lazy_error_classes.rb, line 41
def error_class(code)
  module_eval("#{self}::#{code.gsub(".","::")}")
end
included(mod) click to toggle source
# File lib/aws/core/lazy_error_classes.rb, line 45
def included(mod)
  raise NotImplementedError.new("#{self} lazy-generates error classes; "+
                                "therefore it is not suitable for "+
                                "inclusion in other modules")
end