class Crystal::If
inherits Crystal::ASTNode
¶
An if expression.
'if' cond
then
[
'else'
else
]
'end'
An if elsif end is parsed as an If whose else is another If.
Class methods¶
Methods¶
#==(other : self)
¶
(other : self)
Returns true
if this reference is the same as other. Invokes same?
.
#falsey=(falsey)
¶
(falsey)
This is set to true
when the compiler is sure that the condition is falsey
#falsey? : Bool
¶
: Bool
This is set to true
when the compiler is sure that the condition is falsey
#hash(hasher)
¶
(hasher)
#interpret(method : String, args : Array(ASTNode), named_args : Hash(String, ASTNode)?, block : Crystal::Block?, interpreter : Crystal::MacroInterpreter, name_loc : Location?)
¶
(method : String, args : Array(ASTNode), named_args : Hash(String, ASTNode)?, block : Crystal::Block?, interpreter : Crystal::MacroInterpreter, name_loc : Location?)
#truthy=(truthy)
¶
(truthy)
This is set to true
when the compiler is sure that the condition is truthy
#truthy? : Bool
¶
: Bool
This is set to true
when the compiler is sure that the condition is truthy