class DataError

DataError. @description

Implements the DataError exception class interface.

@attr message [String]

The error explanation.

DataError. @class_description

Implements the DataError interface.

@attr message [String]

The error explanation.

Constants

VERSION

Public Class Methods

new(message = DEFAULT_MESSAGE) click to toggle source

initialize(message = DEFAULT_MESSAGE). @description

Initializes an error.

@param message [String]

An error explanation. Defaults the default message.

@return [DataError]

The error instance.
# File lib/data_error_impl.rb, line 20
def initialize(message = DEFAULT_MESSAGE)
  self.message = message
end

Public Instance Methods

message() click to toggle source

message(). @description

Gets message.

@return [String]

The error message reference.
# File lib/data_error_impl.rb, line 29
def message()
  return @message.freeze()
end

Private Instance Methods

message=(explanation = nil) click to toggle source

message=(explanation = nil). @description

Sets message.

@param explanation [String]

The error message.

@raise [ArgumentError]

In the case the explanation is not a String instance.
# File lib/data_error_impl.rb, line 42
def message=(explanation = nil)

  if (!explanation.instance_of?(String))
    raise(ArgumentError, "#{explanation} is not a String.")
  else
    @message = explanation
  end

end