Class: RedSnow::Sourcemap::ResourceGroup

Inherits:
NamedNode show all
Defined in:
lib/redsnow/sourcemap.rb

Overview

Resource group source map node

Instance Attribute Summary collapse

Attributes inherited from NamedNode

#description, #name

Attributes inherited from Node

#collection

Instance Method Summary collapse

Constructor Details

#initialize(sourcemap) ⇒ ResourceGroup

Returns a new instance of ResourceGroup.

Parameters:

  • sourcemap (json)


228
229
230
231
232
233
234
235
# File 'lib/redsnow/sourcemap.rb', line 228

def initialize(sourcemap)
  super(sourcemap)

  @resources = []
  sourcemap.key?('resources') && sourcemap['resources'].each do |resource|
    @resources << Resource.new(resource)
  end
end

Instance Attribute Details

#resourcesArray<Resource>

array of resources in the group

Returns:

  • (Array<Resource>)

    the current value of resources



224
225
226
# File 'lib/redsnow/sourcemap.rb', line 224

def resources
  @resources
end