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



111
112
113
114
115
116
117
# File 'lib/uniword/errors.rb', line 111

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



123
124
125
# File 'lib/uniword/errors.rb', line 123

def context
  @context
end

#operationString (readonly)

Returns The operation.

Returns:

  • (String)

    The operation



120
121
122
# File 'lib/uniword/errors.rb', line 120

def operation
  @operation
end