Exception: Error

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

Overview

A base class for Error classes in your application.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target = nil) ⇒ Error

Returns a new instance of Error.

Parameters:

  • target (defaults to: nil)

    The target of the error.



12
13
14
# File 'lib/error.rb', line 12

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

Instance Attribute Details

#targetObject

The target of the error.



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

def target
  @target
end

Instance Method Details

#to_sString

The String to print.

Returns:

  • (String)


19
20
21
# File 'lib/error.rb', line 19

def to_s
  @target.to_s
end