Exception: KXI::Exceptions::AbstractException

Inherits:
Exception
  • Object
show all
Defined in:
lib/kxi/exceptions/abstract_exception.rb

Overview

Raised when method that was supposed to be implemented by super class wasn’t

Instance Method Summary collapse

Constructor Details

#initialize(cl) ⇒ AbstractException

Instantiates the KXI::Exceptions::AbstractException class

Parameters:

  • cl (Class)

    Abstract class



26
27
28
29
30
31
32
# File 'lib/kxi/exceptions/abstract_exception.rb', line 26

def initialize(cl)
	frame = Reflection::StackFrame.callstack(3).first
	@file = frame.file
	@mtd = frame.method
	super("Abstract method #{cl.name}##{@mtd} wasn't implemented!")
	@class = cl
end

Instance Method Details

#classClass

Returns the abstract class

Returns:

  • (Class)

    Abstract class



8
9
10
# File 'lib/kxi/exceptions/abstract_exception.rb', line 8

def class
	@class
end

#fileString

Returns the file that contains the abstract class

Returns:

  • (String)

    Path of file that contains the abstract class



14
15
16
# File 'lib/kxi/exceptions/abstract_exception.rb', line 14

def file
	@file
end

#methodString

Returns name of the abstract method

Returns:

  • (String)

    Name of the abstract method



20
21
22
# File 'lib/kxi/exceptions/abstract_exception.rb', line 20

def method
	@mtd
end