class

Crystal::Macros::Select

Inherits Crystal::Macros::ASTNode

A select expression.

Every expression node is equivalent to:

select
{% for when_clause in node.whens %}
  {{ when_clause }}
{% end %}
{% else_clause = node.else %}
{% unless else_clause.is_a?(Nop) %}
  else
    {{ else_clause }}
{% end %}
end

Instance methods

else

Returns the else of this select.

Source
whens

Returns the whens of this select.

Source