Class: MarkupMacro
- Inherits:
-
Object
- Object
- MarkupMacro
- Defined in:
- lib/assets/lib/markup_macro.rb
Overview
Macro that can be used in MarkupNode
Usage:
node = MarkupNode(Clerq::Entities::Node.new(
id: 'id', body: Some text that contains {{@@macro}}")
)
macro = Macro.new
macro.(node.body, node) # "Some text that contains [processed macro]"
Instance Attribute Summary collapse
-
#regex ⇒ Object
readonly
Returns the value of attribute regex.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#process(macro, node) ⇒ String
TODO: find more situable name Process macro that must be implemented in subclasses.
Instance Attribute Details
#regex ⇒ Object (readonly)
Returns the value of attribute regex.
12 13 14 |
# File 'lib/assets/lib/markup_macro.rb', line 12 def regex @regex end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
12 13 14 |
# File 'lib/assets/lib/markup_macro.rb', line 12 def title @title end |
Instance Method Details
#process(macro, node) ⇒ String
TODO: find more situable name Process macro that must be implemented in subclasses
18 19 |
# File 'lib/assets/lib/markup_macro.rb', line 18 def process(macro, node) end |