Class: RedSnow::Blueprint
- Inherits:
-
NamedBlueprintNode
- Object
- BlueprintNode
- NamedBlueprintNode
- RedSnow::Blueprint
- Defined in:
- lib/redsnow/blueprint.rb
Overview
Top-level Blueprint AST node
represents 'blueprint section'
Constant Summary collapse
- VERSION_KEY =
Version key
:_version
- SUPPORTED_VERSIONS =
Supported version of Api Blueprint
['3.0']
Instance Attribute Summary collapse
-
#metadata ⇒ Metadata
tool-specific metadata collection or nil.
-
#resource_groups ⇒ Array<ResourceGroup>
array of blueprint resource groups.
Attributes inherited from NamedBlueprintNode
Instance Method Summary collapse
-
#initialize(ast) ⇒ Blueprint
constructor
A new instance of Blueprint.
Methods inherited from NamedBlueprintNode
Constructor Details
#initialize(ast) ⇒ Blueprint
Returns a new instance of Blueprint.
357 358 359 360 361 362 363 364 365 366 |
# File 'lib/redsnow/blueprint.rb', line 357 def initialize(ast) @name = ast.fetch('name', '') @description = ast.fetch('description', '') @metadata = Metadata.new(ast.fetch('metadata', nil)) @resource_groups = [] ast.key?('resourceGroups') && ast['resourceGroups'].each do |resource_group| @resource_groups << ResourceGroup.new(resource_group) end end |
Instance Attribute Details
#metadata ⇒ Metadata
tool-specific metadata collection or nil
346 347 348 |
# File 'lib/redsnow/blueprint.rb', line 346 def @metadata end |
#resource_groups ⇒ Array<ResourceGroup>
array of blueprint resource groups
346 347 348 |
# File 'lib/redsnow/blueprint.rb', line 346 def resource_groups @resource_groups end |