lib/bmg/support/tuple_transformer.rb in bmg-0.17.8 vs lib/bmg/support/tuple_transformer.rb in bmg-0.18.0

- old
+ new

@@ -24,18 +24,14 @@ private def transform_tuple(tuple, with) case with - when Symbol + when Symbol, Proc, Regexp tuple.each_with_object({}){|(k,v),dup| dup[k] = transform_attr(v, with) } - when Proc - tuple.each_with_object({}){|(k,v),dup| - dup[k] = transform_attr(v, with) - } when Hash with.each_with_object(tuple.dup){|(k,v),dup| dup[k] = transform_attr(dup[k], v) } when Array @@ -49,9 +45,12 @@ def transform_attr(value, with) case with when Symbol value.send(with) + when Regexp + m = with.match(value.to_s) + m.nil? ? m : m.to_s when Proc with.call(value) when Hash with[value] else \ No newline at end of file