class

Crystal::Macros::MacroIf

Inherits Crystal::Macros::ASTNode

An if/unless inside a macro, e.g.

{% if cond %}
  puts "Then"
{% else %}
  puts "Else"
{% end %}

{% unless cond %}
  puts "Then"
{% else %}
  puts "Else"
{% end %}

Instance methods

cond

The condition of the if clause.

Source
else

The else branch of the if.

Source
is_unless?

Returns true if this node represents an unless conditional, otherwise returns false.

Source
then

The then branch of the if.

Source