Class: CucumberFM::Aggregator::Collection

Inherits:
Hash
  • Object
show all
Includes:
FeatureElement::Component::TotalEstimation
Defined in:
lib/cucumber_f_m/aggregator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FeatureElement::Component::TotalEstimation

#estimation, #estimation_done, #estimation_done_percentage, #scenarios_done, #scenarios_done_percentage

Class Method Details

.nested_hash(level = 1) ⇒ Object



52
53
54
55
56
# File 'lib/cucumber_f_m/aggregator.rb', line 52

def Collection.nested_hash (level=1)
  new do |hash, key|
    hash[key]= (level > 0 ? nested_hash(level-1) : ScenarioCollection.new)
  end
end

Instance Method Details

#featuresObject



40
41
42
43
44
# File 'lib/cucumber_f_m/aggregator.rb', line 40

def features
  keys.collect { |key|
    self[key].is_a?(Array) ? key : self[key].features
  }.flatten.uniq
end

#scenariosObject



46
47
48
49
50
# File 'lib/cucumber_f_m/aggregator.rb', line 46

def scenarios
  values.collect { |value|
    value.is_a?(Array) ? value : value.scenarios
  }.flatten
end