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

["2.1"]

Instance Attribute Summary collapse

Attributes inherited from NamedBlueprintNode

#description, #name

Instance Method Summary collapse

Methods inherited from NamedBlueprintNode

#ensure_description_newlines

Constructor Details

#initialize(handle) ⇒ Blueprint

Returns a new instance of Blueprint.

Parameters:

  • handle (FFI:Pointer)


412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/redsnow/blueprint.rb', line 412

def initialize(handle)
  # BP name, desc
  @name = RedSnow::Binding.sc_blueprint_name(handle)
  @description = RedSnow::Binding.sc_blueprint_description(handle)

  # BP metadata
   = RedSnow::Binding.(handle)
  @metadata = Metadata.new()

  # BP Resource Groups
  sc_resource_group_collection_handle = RedSnow::Binding.sc_resource_group_collection_handle(handle)
  sc_resource_group_collection_size = RedSnow::Binding.sc_resource_group_collection_size(sc_resource_group_collection_handle)
  @resource_groups = Array.new

  if sc_resource_group_collection_size > 0
    group_size = sc_resource_group_collection_size - 1

    for index in 0..group_size do
      sc_resource_group_handle = RedSnow::Binding.sc_resource_group_handle(sc_resource_group_collection_handle, index)
      @resource_groups << ResourceGroup.new(sc_resource_group_handle)
    end
  end
end

Instance Attribute Details

#metadataMetadata

tool-specific metadata collection or nil

Returns:

  • (Metadata)

    the current value of metadata



400
401
402
# File 'lib/redsnow/blueprint.rb', line 400

def 
  @metadata
end

#resource_groupsArray<ResourceGroup>

array of blueprint resource groups

Returns:

  • (Array<ResourceGroup>)

    the current value of resource_groups



400
401
402
# File 'lib/redsnow/blueprint.rb', line 400

def resource_groups
  @resource_groups
end