Class: RedSnow::ResourceGroup

Inherits:
NamedBlueprintNode show all
Defined in:
lib/redsnow/blueprint.rb

Overview

Resource group Blueprint AST node represents 'resource group section'

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ResourceGroup) initialize(sc_resource_groups_handle)

Returns a new instance of ResourceGroup

Parameters:

  • sc_resource_groups_handle (FFI::Pointer)


309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/redsnow/blueprint.rb', line 309

def initialize(sc_resource_groups_handle)
  @name = RedSnow::Binding.sc_resource_groups_name(sc_resource_groups_handle)
  @description = RedSnow::Binding.sc_resource_groups_description(sc_resource_groups_handle)

  @resources = Array.new
  sc_resource_collection_handle = RedSnow::Binding.sc_resource_collection_handle(sc_resource_groups_handle)
  sc_resource_collection_size = RedSnow::Binding.sc_resource_collection_size(sc_resource_collection_handle)
  if sc_resource_collection_size > 0
    resource_size = sc_resource_collection_size - 1
    for index in 0..resource_size do
      sc_resource_handle = RedSnow::Binding.sc_resource_handle(sc_resource_collection_handle, index)
      res = Resource.new(sc_resource_handle)
    end
  end
  @resources << res
end

Instance Attribute Details

- (String) description Originally defined in class NamedBlueprintNode

description of the node

Returns:

  • (String)

    the current value of description

- (String) name Originally defined in class NamedBlueprintNode

name of the node

Returns:

  • (String)

    the current value of name

- (Array<Resource>) resources

array of resources in the group

Returns:

  • (Array<Resource>)

    the current value of resources



305
306
307
# File 'lib/redsnow/blueprint.rb', line 305

def resources
  @resources
end