Class: OpenHAB::Core::Actions::Transformation

Inherits:
Object
  • Object
show all
Defined in:
lib/openhab/core/actions/transformation.rb

Overview

See Also:

  • orgorg.openhaborg.openhab.coreorg.openhab.core.transformorg.openhab.core.transform.actionsorg.openhab.core.transform.actions.Transformation

Class Method Summary collapse

Class Method Details

.transform(type, function, value) ⇒ String

Applies a transformation of a given type with some function to a value.

Examples:

Run a transformation

transform(:map, "myfan.map", 0)

Parameters:

  • type (String, Symbol)

    The transformation type, e.g. REGEX or MAP

  • function (String, Symbol)

    The function to call. This value depends on the transformation type

  • value (String)

    The value to apply the transformation to

Returns:

  • (String)

    the transformed value, or the original value if an error occurred



25
26
27
# File 'lib/openhab/core/actions/transformation.rb', line 25

def transform(type, function, value)
  raw_transform(type.to_s.upcase, function.to_s, value.to_s)
end