Class: LiquidXlsx::Nodes::IfNode

Inherits:
Base
  • Object
show all
Defined in:
lib/liquid_xlsx/template_nodes.rb

Overview

An if/elsif/else node: conditional block.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(branches, if_row: nil, endif_row: nil) ⇒ IfNode

branches: [body:, ...] Last branch may have condition: nil for else



51
52
53
54
55
# File 'lib/liquid_xlsx/template_nodes.rb', line 51

def initialize(branches, if_row: nil, endif_row: nil)
  @branches = branches
  @if_row = if_row
  @endif_row = endif_row
end

Instance Attribute Details

#branchesObject (readonly)

Returns the value of attribute branches.



47
48
49
# File 'lib/liquid_xlsx/template_nodes.rb', line 47

def branches
  @branches
end

#endif_rowObject (readonly)

Returns the value of attribute endif_row.



47
48
49
# File 'lib/liquid_xlsx/template_nodes.rb', line 47

def endif_row
  @endif_row
end

#if_rowObject (readonly)

Returns the value of attribute if_row.



47
48
49
# File 'lib/liquid_xlsx/template_nodes.rb', line 47

def if_row
  @if_row
end

Instance Method Details

#rows_after_renderObject



57
58
59
# File 'lib/liquid_xlsx/template_nodes.rb', line 57

def rows_after_render
  0 # dynamic
end