Exception: ExistException

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/exist_exception.rb

Overview

To change this template, choose Tools | Templates and open the template in the editor.

Instance Method Summary collapse

Constructor Details

#initialize(_description = "Epic fail \n", _number = nil) ⇒ ExistException

Returns a new instance of ExistException.



9
10
11
12
# File 'lib/exist_exception.rb', line 9

def initialize(_description = "Epic fail \n", _number = nil)
  @description = _description + "\n"
  @number  = _number
end

Instance Method Details

#codeObject



26
27
28
# File 'lib/exist_exception.rb', line 26

def code
  @number
end

#inspectObject



14
15
16
# File 'lib/exist_exception.rb', line 14

def inspect
  self.tostring
end

#to_sObject



18
19
20
# File 'lib/exist_exception.rb', line 18

def to_s
  self.tostring
end

#tostringObject



22
23
24
# File 'lib/exist_exception.rb', line 22

def tostring
  @number.to_s + ": " +@description
end