Method: OpenHAB::DSL.transform

Defined in:
lib/openhab/dsl.rb

.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



577
578
579
# File 'lib/openhab/dsl.rb', line 577

def transform(type, function, value)
  Transformation.transform(type, function, value)
end