Module: Sevgi::Geometry::Operation

Extended by:
Operation
Included in:
Operation
Defined in:
lib/sevgi/geometry/operation.rb,
lib/sevgi/geometry/operation/align.rb,
lib/sevgi/geometry/operation/sweep.rb

Overview

Dispatches geometry operations to operation handler modules.

Defined Under Namespace

Modules: Align, Sweep

Constant Summary collapse

OperationError =

Raised when an operation starts but cannot complete.

Class.new(Error)
OperationInapplicableError =

Raised when an operation does not apply to the target element.

Class.new(Error)

Instance Method Summary collapse

Instance Method Details

#register(handler, *operations) ⇒ Array<Symbol>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Registers one or more public operation methods.

Parameters:

  • handler (Module)

    operation handler module

  • operations (Array<Symbol>)

    operation method names

Returns:

  • (Array<Symbol>)

    registered operation names



20
# File 'lib/sevgi/geometry/operation.rb', line 20

def register(handler, *operations) = operations.each { |operation| def_operation(operation, handler) }