Exception: Uniword::UnsupportedOperationError

Inherits:
Error
  • Object
show all
Defined in:
lib/uniword/errors.rb

Overview

Raised when an unsupported operation is attempted

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operation, context = nil) ⇒ UnsupportedOperationError

Returns a new instance of UnsupportedOperationError.

Parameters:

  • operation (String)

    The unsupported operation

  • context (String) (defaults to: nil)

    Additional context



104
105
106
107
108
109
110
# File 'lib/uniword/errors.rb', line 104

def initialize(operation, context = nil)
  message = "Unsupported operation: #{operation}"
  message += " (#{context})" if context
  super(message)
  @operation = operation
  @context = context
end

Instance Attribute Details

#contextString? (readonly)

Returns The context.

Returns:

  • (String, nil)

    The context



116
117
118
# File 'lib/uniword/errors.rb', line 116

def context
  @context
end

#operationString (readonly)

Returns The operation.

Returns:

  • (String)

    The operation



113
114
115
# File 'lib/uniword/errors.rb', line 113

def operation
  @operation
end