Sha256: c29c3525f35350ebad89b2e0036a3137dd463399e29d2c1e7a9d73cf7e66c4d5

Contents?: true

Size: 618 Bytes

Versions: 14

Compression:

Stored size: 618 Bytes

Contents

Sometimes, you want to apply polymorphism to your templates; this it is really easy to do in wlang thanks to its high-order constructions.

For example, assume that you iterate some data and want render a partial in a polymorphism way, that is, selecting the partial according to some type, here the shape of the current iterated component. This is really simple:

    <ul>
      <li> Hello [] of width 10cm </li>
      <li> Hello () of diameter 25cm </li>
    </ul>

Which gives the following result:

    <ul>
      <li> Hello [] of width 10cm </li>
      <li> Hello () of diameter 25cm <li>
    </ul>

Great, isn't?

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
wlang-3.0.1 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-3.0.0 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.3.1 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.3.0 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.2.4 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.2.3 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.2.2 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.2.1 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.2.0 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.1.2 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.1.1 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.1.0 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.0.1 spec/integration/examples/1-html-intro/5-polymorphism.md
wlang-2.0.0 spec/integration/examples/1-html-intro/5-polymorphism.md