Class: JsxRosetta::IR::Conditional
- Inherits:
-
Data
- Object
- Data
- JsxRosetta::IR::Conditional
- Includes:
- Node
- Defined in:
- lib/jsx_rosetta/ir/types.rb
Overview
A conditional render. Lowered from any of:
{cond && <X />}
{cond ? <X /> : null}
{cond ? <X /> : <Y />}
test : Interpolation — verbatim JS source of the condition. consequent : Node — what to render when test is truthy. alternate : Node | nil — what to render otherwise (nil for ‘cond &&`
or for `cond ? X : null`).
Instance Attribute Summary collapse
-
#alternate ⇒ Object
readonly
Returns the value of attribute alternate.
-
#consequent ⇒ Object
readonly
Returns the value of attribute consequent.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
Instance Attribute Details
#alternate ⇒ Object (readonly)
Returns the value of attribute alternate
195 196 197 |
# File 'lib/jsx_rosetta/ir/types.rb', line 195 def alternate @alternate end |
#consequent ⇒ Object (readonly)
Returns the value of attribute consequent
195 196 197 |
# File 'lib/jsx_rosetta/ir/types.rb', line 195 def consequent @consequent end |
#test ⇒ Object (readonly)
Returns the value of attribute test
195 196 197 |
# File 'lib/jsx_rosetta/ir/types.rb', line 195 def test @test end |