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 and 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
20 21 22 |
# File 'lib/redsnow/blueprint.rb', line 20 def description @description end |
#name ⇒ String
name of the node
20 21 22 |
# File 'lib/redsnow/blueprint.rb', line 20 def name @name end |
Instance Method Details
#ensure_description_newlines(buffer) ⇒ Object
Ensure the input string buffer ends with two newlines.
29 30 31 32 33 34 35 36 37 |
# File 'lib/redsnow/blueprint.rb', line 29 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 |