Module: Cuporter::Node::Totalling

Included in:
BaseMethods
Defined in:
lib/cuporter/node/totalling.rb

Instance Method Summary collapse

Instance Method Details

#totalObject



6
7
8
9
# File 'lib/cuporter/node/totalling.rb', line 6

def total
  total!
  children.each {|child| child.total }
end

#total!Object



11
12
13
14
15
# File 'lib/cuporter/node/totalling.rb', line 11

def total!
  t = search("scenario,example").size
  self["total"] = t.to_s if t > 0
  nil
end