Class: Sbuilder::ParamSets

Inherits:
Hash
  • Object
show all
Includes:
TSort
Defined in:
lib/sbuilder/param_sets.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Hash

#[], #__fetch, #traverse

Constructor Details

#initialize(model) ⇒ ParamSets

class methods



24
25
26
# File 'lib/sbuilder/param_sets.rb', line 24

def initialize( model )
  @model = model
end

Instance Attribute Details

#modelObject (readonly)

to resolve paramSets



7
8
9
# File 'lib/sbuilder/param_sets.rb', line 7

def model
  @model
end

Class Method Details

.create(model) ⇒ Object



16
17
18
# File 'lib/sbuilder/param_sets.rb', line 16

def create( model )
  new( model )
end

Instance Method Details

#tsort_each_child(paramSetName, &block) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/sbuilder/param_sets.rb', line 33

def tsort_each_child( paramSetName, &block)

  # # no depencies if no name ??
  # return unless key?( paramSetName )
  
  # access the object to sort
  # puts "fetch(#{paramSetName}) in #{keys}"
  paramSet = fetch(paramSetName)
  
  # find dependencies amongst the refenced paramSets (TestCase)
  paramSet.parameters.
    select do |parameter|
    parameter.isReference
  end.                                                      # consider only refences
    map do |parameter|
    # parameter.deReference( model ).getId
    parameter.getResolvedReference.getId        
  end.                                                      # resolve paramSet referenced
    each(&block)                                            # process tsort block for each paramSetname
end