Class: RazorRisk::Razor::Control::Exceptions::ControlException Abstract

Inherits:
Core::Diagnostics::Exceptions::RRCSBaseException
  • Object
show all
Includes:
Pantheios
Defined in:
lib/razor_risk/razor/control/exceptions.rb

Overview

This class is abstract.

Root exception class for Control module

Defined Under Namespace

Modules: Constants

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, **options) ⇒ ControlException

Initialises an instance, based on the given message and options

Parameters:

  • message (String)

    The exception message/

  • options (Hash)

    The options hash.

  • cause (Hash)

    a customizable set of options



78
79
80
81
82
83
84
85
# File 'lib/razor_risk/razor/control/exceptions.rb', line 78

def initialize message, **options

    trace ParamNames[ :message, :options ], message, options

    super message, **options

    @options = {}.merge! options
end

Instance Attribute Details

#options::Hash (readonly)

Returns the options hash.

Returns:

  • (::Hash)

    the options hash.



69
70
71
# File 'lib/razor_risk/razor/control/exceptions.rb', line 69

def options
  @options
end

Class Method Details

.new(*args) ⇒ Object

Override of new to enforce abstract exception classes cannot be constructed.



58
59
60
61
62
63
64
65
66
# File 'lib/razor_risk/razor/control/exceptions.rb', line 58

def self.new *args

    if Constants::ABSTRACT_CLASSES.include?(self.name.split('::')[-1])

        raise NoMethodError, "private method `new' called for #{self}:Class"
    end

    super
end