Exception: MIME::AbstractClassError

Inherits:
Error
  • Object
show all
Defined in:
lib/mime/error.rb

Overview

Abstract class object initialization error. Many classes in the MIME library are abstract and will raise this error.

Class Method Summary collapse

Class Method Details

.no_instantiation(myself, klass) ⇒ Object

A helper method for detecting the intialization of an object in an abstract class. myself must always be self and klass is the abstract class object.



24
25
26
27
28
# File 'lib/mime/error.rb', line 24

def self.no_instantiation myself, klass
  if myself.class == klass
    raise AbstractClassError.new('cannot construct abstract class')
  end
end