Class: RedSnow::NamedBlueprintNode Abstract
- Inherits:
-
BlueprintNode
- Object
- BlueprintNode
- RedSnow::NamedBlueprintNode
- Defined in:
- lib/redsnow/blueprint.rb
Overview
This class is abstract.
Blueprint AST node with name && description associated
Direct Known Subclasses
Action, Blueprint, Parameter, Payload, Resource, ResourceGroup, TransactionExample
Instance Attribute Summary collapse
-
#description ⇒ String
description of the node.
-
#name ⇒ String
name of the node.
Instance Method Summary collapse
-
#ensure_description_newlines(buffer) ⇒ Object
Ensure the input string buffer ends with two newlines.
Instance Attribute Details
#description ⇒ String
description of the node
32 33 34 |
# File 'lib/redsnow/blueprint.rb', line 32 def description @description end |
#name ⇒ String
name of the node
32 33 34 |
# File 'lib/redsnow/blueprint.rb', line 32 def name @name end |
Instance Method Details
#ensure_description_newlines(buffer) ⇒ Object
Ensure the input string buffer ends with two newlines.
40 41 42 43 44 45 46 47 48 |
# File 'lib/redsnow/blueprint.rb', line 40 def ensure_description_newlines(buffer) return if description.empty? if description[-1, 1] != '\n' buffer << '\n\n' elsif description.length > 1 && description[-2, 1] != '\n' buffer << '\n' end end |