aboutsummaryrefslogtreecommitdiffstats
path: root/testing/templates/match-custom-enum.html
diff options
context:
space:
mode:
authorLibravatar Anthony Nowell <anowell@gmail.com>2017-11-01 21:19:34 -0700
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-11-02 15:11:20 +0100
commit2257afd356e6985244e702554aeda74af63b7ff1 (patch)
treee4850337eb72afb32cbd259f3b79f114cef05a9b /testing/templates/match-custom-enum.html
parent89a90eb46c822957af5b6aef8615a7d7398e7de4 (diff)
downloadaskama-2257afd356e6985244e702554aeda74af63b7ff1.tar.gz
askama-2257afd356e6985244e702554aeda74af63b7ff1.tar.bz2
askama-2257afd356e6985244e702554aeda74af63b7ff1.zip
Support matching custom enums
Diffstat (limited to 'testing/templates/match-custom-enum.html')
-rw-r--r--testing/templates/match-custom-enum.html8
1 files changed, 8 insertions, 0 deletions
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 %}