Lava Example - 17
Prompt
Once again, you have Cindy Decker in a variable called {{ personOne }} and Ted Decker is in {{ personTwo }}.
Rewrite the below if statement using Case instead.
Initial Code
{% assign person = personOne %}
{% if person.Gender == 'Female' %}
You're invited to The Grove at Rock Solid Church.
{% elseif person.Gender == 'Male' %}
The women in your life are invited to The Grove at Rock Solid Church.
{% else %}
Welcome to The Grove, the Women's ministry at Rock Solid Church.
{% endif %}
Solution Lava
{% assign person = personOne %}
{% case person.Gender %}
{% when 'Female' %}
You're invited to The Grove at Rock Solid Church.
{% when 'Male' %}
The women in your life are invited to The Grove at Rock Solid Church.
{% else %}
Welcome to The Grove, the Women's ministry at Rock Solid Church.
{% endcase %}