Class: JsxRosetta::IR::Loop
- Inherits:
-
Data
- Object
- Data
- JsxRosetta::IR::Loop
- Includes:
- Node
- Defined in:
- lib/jsx_rosetta/ir/types.rb
Overview
A list-rendering loop. Lowered from a JSX expression of the form:
{items.map((item) => <X />)}
{items.map((item, index) => <X />)}
plus the arrow-with-block form ‘(item) => { return <X />; }`.
iterable : Interpolation — verbatim source of the iterable
expression (e.g. "items", "todos.filter(...)").
item_binding : String — name of the item parameter, in original
camelCase. Backends snake_case as needed.
index_binding : String | nil — name of the index parameter, if present. body : Node — the lowered IR node rendered for each iteration.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#index_binding ⇒ Object
readonly
Returns the value of attribute index_binding.
-
#item_binding ⇒ Object
readonly
Returns the value of attribute item_binding.
-
#iterable ⇒ Object
readonly
Returns the value of attribute iterable.
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body
272 273 274 |
# File 'lib/jsx_rosetta/ir/types.rb', line 272 def body @body end |
#index_binding ⇒ Object (readonly)
Returns the value of attribute index_binding
272 273 274 |
# File 'lib/jsx_rosetta/ir/types.rb', line 272 def index_binding @index_binding end |
#item_binding ⇒ Object (readonly)
Returns the value of attribute item_binding
272 273 274 |
# File 'lib/jsx_rosetta/ir/types.rb', line 272 def item_binding @item_binding end |
#iterable ⇒ Object (readonly)
Returns the value of attribute iterable
272 273 274 |
# File 'lib/jsx_rosetta/ir/types.rb', line 272 def iterable @iterable end |