Class: LiquidXlsx::Nodes::ForNode
- Defined in:
- lib/liquid_xlsx/template_nodes.rb
Overview
A for loop node: iterates over a collection.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#collection_name ⇒ Object
readonly
Returns the value of attribute collection_name.
-
#else_body ⇒ Object
readonly
Returns the value of attribute else_body.
-
#endfor_row ⇒ Object
readonly
Returns the value of attribute endfor_row.
-
#for_row ⇒ Object
readonly
Returns the value of attribute for_row.
-
#variable_name ⇒ Object
readonly
Returns the value of attribute variable_name.
Instance Method Summary collapse
-
#initialize(variable_name, collection_name, body, else_body = nil, for_row: nil, endfor_row: nil) ⇒ ForNode
constructor
A new instance of ForNode.
- #rows_after_render ⇒ Object
Constructor Details
#initialize(variable_name, collection_name, body, else_body = nil, for_row: nil, endfor_row: nil) ⇒ ForNode
Returns a new instance of ForNode.
30 31 32 33 34 35 36 37 |
# File 'lib/liquid_xlsx/template_nodes.rb', line 30 def initialize(variable_name, collection_name, body, else_body = nil, for_row: nil, endfor_row: nil) @variable_name = variable_name @collection_name = collection_name @body = body @else_body = else_body @for_row = for_row @endfor_row = endfor_row end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
28 29 30 |
# File 'lib/liquid_xlsx/template_nodes.rb', line 28 def body @body end |
#collection_name ⇒ Object (readonly)
Returns the value of attribute collection_name.
28 29 30 |
# File 'lib/liquid_xlsx/template_nodes.rb', line 28 def collection_name @collection_name end |
#else_body ⇒ Object (readonly)
Returns the value of attribute else_body.
28 29 30 |
# File 'lib/liquid_xlsx/template_nodes.rb', line 28 def else_body @else_body end |
#endfor_row ⇒ Object (readonly)
Returns the value of attribute endfor_row.
28 29 30 |
# File 'lib/liquid_xlsx/template_nodes.rb', line 28 def endfor_row @endfor_row end |
#for_row ⇒ Object (readonly)
Returns the value of attribute for_row.
28 29 30 |
# File 'lib/liquid_xlsx/template_nodes.rb', line 28 def for_row @for_row end |
#variable_name ⇒ Object (readonly)
Returns the value of attribute variable_name.
28 29 30 |
# File 'lib/liquid_xlsx/template_nodes.rb', line 28 def variable_name @variable_name end |
Instance Method Details
#rows_after_render ⇒ Object
39 40 41 42 |
# File 'lib/liquid_xlsx/template_nodes.rb', line 39 def rows_after_render # Dynamic: depends on collection size 0 # mark as dynamic end |