Class: RedSnow::Blueprint

Inherits:
NamedBlueprintNode show all
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

Attributes inherited from NamedBlueprintNode

#description, #name

Instance Method Summary collapse

Methods inherited from NamedBlueprintNode

#ensure_description_newlines

Constructor Details

#initialize(ast) ⇒ Blueprint

Returns a new instance of Blueprint.

Parameters:

  • ast (json)


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

#metadataMetadata

tool-specific metadata collection or nil

Returns:

  • (Metadata)

    the current value of metadata



346
347
348
# File 'lib/redsnow/blueprint.rb', line 346

def 
  @metadata
end

#resource_groupsArray<ResourceGroup>

array of blueprint resource groups

Returns:

  • (Array<ResourceGroup>)

    the current value of resource_groups



346
347
348
# File 'lib/redsnow/blueprint.rb', line 346

def resource_groups
  @resource_groups
end