class NodeError

NodeError. @class_description

A NodeError library's implementation.

@attr message [String]

An error message.

NodeError. @class_description

A NodeError library's implementation.

@attr message [String]

An error message.

Constants

DEFAULT_MESSAGE

Constants.

VERSION

Public Class Methods

new(message = DEFAULT_MESSAGE) click to toggle source

initialize(message = DEFAULT_MESSAGE). @description

Initializes a NodeError instance.

@param message [String]

An error message.

@return [NodeError]

A NodeError instance.
# File lib/node_error_impl.rb, line 23
def initialize(message = DEFAULT_MESSAGE)
  self.message = message
end

Public Instance Methods

message() click to toggle source

message(). @description

Gets the error message.

@return [String]

The message String, frozen.
# File lib/node_error_impl.rb, line 32
def message()
  return @message.freeze()
end

Private Instance Methods

message=(explanation = nil) click to toggle source

message=(explanation = nil). @description

Sets the message attribute.

@param explanation [String]

A NodeError explanation.

@raise [TypeError]

In the case the argument is anything other than a String instance.

@return [String]

The argument.
# File lib/node_error_impl.rb, line 47
def message=(explanation = nil)

  unless (explanation.instance_of?(String))
    raise(TypeError, "The explanation #{explanation} is not a String.")
  else
    @message = explanation
  end

end