From 2257afd356e6985244e702554aeda74af63b7ff1 Mon Sep 17 00:00:00 2001 From: Anthony Nowell Date: Wed, 1 Nov 2017 21:19:34 -0700 Subject: Support matching custom enums --- testing/templates/match-custom-enum.html | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 testing/templates/match-custom-enum.html (limited to 'testing/templates/match-custom-enum.html') diff --git a/testing/templates/match-custom-enum.html b/testing/templates/match-custom-enum.html new file mode 100644 index 0000000..cb45b8f --- /dev/null +++ b/testing/templates/match-custom-enum.html @@ -0,0 +1,8 @@ +{% match color %} +{% when Color::Rgb with (r, g, b) %} +Colorful: #{{ "{:02X}"|format(r) }}{{ "{:02X}"|format(g) }}{{ "{:02X}"|format(b) }} +{% when Color::GrayScale with (val) %} +Gray: #{{ "{:02X}"|format(val) }}{{ "{:02X}"|format(val) }}{{ "{:02X}"|format(val) }} +{% else %} +CMYK not supported +{% endmatch %} -- cgit