Class: Fmt::Template
Overview
Instance Attribute Summary collapse
-
#embeds ⇒ Object
readonly
: Array.
-
#pipelines ⇒ Object
readonly
: Array.
Attributes inherited from Model
AST Processors collapse
- #on_embed(node) ⇒ Object
- #on_embeds(node) ⇒ Object
- #on_pipeline(node) ⇒ Object
- #on_pipelines(node) ⇒ Object
-
#on_template(node) ⇒ Object
.….….….….….….….….….….….….….….….….….…..
Instance Method Summary collapse
-
#initialize(ast) ⇒ Template
constructor
Constructor.
- #to_h ⇒ Object
Methods inherited from Model
Methods included from Matchable
#deconstruct, #deconstruct_keys
Constructor Details
#initialize(ast) ⇒ Template
Constructor
17 18 19 20 21 |
# File 'lib/fmt/models/template.rb', line 17 def initialize(ast) = [] @pipelines = [] super end |
Instance Attribute Details
#pipelines ⇒ Object (readonly)
: Array
24 25 26 |
# File 'lib/fmt/models/template.rb', line 24 def pipelines @pipelines end |
Instance Method Details
#on_embed(node) ⇒ Object
43 44 45 |
# File 'lib/fmt/models/template.rb', line 43 def (node) << Embed.new(node) end |
#on_embeds(node) ⇒ Object
39 40 41 |
# File 'lib/fmt/models/template.rb', line 39 def (node) process_all node.children end |
#on_pipeline(node) ⇒ Object
51 52 53 |
# File 'lib/fmt/models/template.rb', line 51 def on_pipeline(node) pipelines << Pipeline.new(node) end |
#on_pipelines(node) ⇒ Object
47 48 49 |
# File 'lib/fmt/models/template.rb', line 47 def on_pipelines(node) process_all node.children end |
#on_template(node) ⇒ Object
.….….….….….….….….….….….….….….….….….….. .….….….….….….….….….….….….….….….….….…..
35 36 37 |
# File 'lib/fmt/models/template.rb', line 35 def on_template(node) process_all node.children end |
#to_h ⇒ Object
27 28 29 |
# File 'lib/fmt/models/template.rb', line 27 def to_h super.merge embeds: .map(&:to_h), pipelines: pipelines.map(&:to_h) end |