Class: AdHocTemplate::Parser::FallbackNode

Inherits:
TagNode
  • Object
show all
Defined in:
lib/ad_hoc_template/parser.rb

Instance Attribute Summary

Attributes inherited from TagNode

#type

Instance Method Summary collapse

Methods inherited from TagNode

#cast, #contains_any_fallback_tag?, #contains_any_value_tag?, #inner_iteration_tag_labels, #push, #select_fallback_nodes

Instance Method Details

#assign_value_to_type(first_leaf) ⇒ Object



137
138
139
140
# File 'lib/ad_hoc_template/parser.rb', line 137

def assign_value_to_type(first_leaf)
  return first_leaf unless first_leaf.kind_of? String
  first_leaf.sub(/\A#{LINE_END_STR}/, '')
end

#contains_any_value_assigned_tag_node?(_record) ⇒ Boolean



142
143
144
# File 'lib/ad_hoc_template/parser.rb', line 142

def contains_any_value_assigned_tag_node?(_record)
  false
end

#format_sub_nodes(data_loader, memo) ⇒ Object



146
147
148
149
# File 'lib/ad_hoc_template/parser.rb', line 146

def format_sub_nodes(data_loader, memo)
  node = cast(Parser::IterationNode)
  node.contains_any_value_tag? ? node.accept(data_loader, memo) : node.join
end