class Crystal::Macros::Select

Overview

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

Defined in:

compiler/crystal/macros.cr

Instance Method Summary

Instance Method Detail

def else : ASTNode #

Returns the #else of this select.


[View source]
def whens : ArrayLiteral(When) #

Returns the whens of this select.


[View source]