Module: Cuprum

Defined in:
lib/cuprum.rb,
lib/cuprum/utils.rb,
lib/cuprum/errors.rb,
lib/cuprum/result.rb,
lib/cuprum/command.rb,
lib/cuprum/version.rb,
lib/cuprum/built_in.rb,
lib/cuprum/chaining.rb,
lib/cuprum/operation.rb,
lib/cuprum/processing.rb,
lib/cuprum/result_helpers.rb,
lib/cuprum/command_factory.rb

Overview

A lightweight, functional-lite toolkit for making business logic a first-class citizen of your application.

Defined Under Namespace

Modules: BuiltIn, Chaining, Errors, Processing, ResultHelpers, Utils, Version Classes: Command, CommandFactory, Operation, Result

Constant Summary collapse

VERSION =

module

Version.to_gem_version

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.warning_proc=(value) ⇒ Proc

Returns The proc called to display a warning message. By default, delegates to Kernel#warn. Set this to configure the warning behavior (e.g. to call a Logger).

Returns:

  • (Proc)

    The proc called to display a warning message. By default, delegates to Kernel#warn. Set this to configure the warning behavior (e.g. to call a Logger).


15
16
17
# File 'lib/cuprum.rb', line 15

def warning_proc=(value)
  @warning_proc = value
end

Class Method Details

.versionString

Returns The current version of the gem.

Returns:

  • (String)

    The current version of the gem.


18
19
20
# File 'lib/cuprum.rb', line 18

def version
  VERSION
end

.warn(message) ⇒ Object

Displays a warning message. By default, delegates to Kernel#warn. The warning behavior can be configured (e.g. to call a Logger) using the #warning_proc= method.

Parameters:

  • message (String)

    The warning message to display.

See Also:

  • #warning_proc=

29
30
31
# File 'lib/cuprum.rb', line 29

def warn message
  warning_proc.call(message)
end