Concat
String concatenation
Signature
concat(expr: AttrName|(Tuple->Numeric)) -> Aggregator
Examples
concat(:name)
concat(:name, between: ', ')
concat(between: ', '){|t| t.name }
concat(->(t){ t.name.upcase }, between: ', ')
Description
Concatenates string representations of input values.
Implementation notes
This aggregate function can be applied to any data type, not only String
attributes. Ruby's to_s will be used on values prior to concatenation.
The options are:
beforestarts the resulting string (defaults to '')afterends the resulting string (defaults to '')betweenis used between each value
As of current Alf version, the order in which the values are concatenated is not guaranteed. So far, this function is thus non-deterministic.