Exception: Decimal::Exception

Inherits:
StandardError
  • Object
show all
Defined in:
lib/decimal/decimal.rb

Overview

Base class for exceptions.

All exception conditions derive from this class. The exception classes also define the values returned when trapping is disable for a particular exception.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context = nil) ⇒ Exception

Returns a new instance of Exception.



84
85
86
# File 'lib/decimal/decimal.rb', line 84

def initialize(context=nil)
  @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



83
84
85
# File 'lib/decimal/decimal.rb', line 83

def context
  @context
end

Class Method Details

.handle(context, *args) ⇒ Object

Defines the value returned when trapping is inactive for the condition. The arguments are those passed to Context#exception after the message.



91
92
# File 'lib/decimal/decimal.rb', line 91

def self.handle(context, *args)
end