Class: Watir::PerformanceData

Inherits:
Object
  • Object
show all
Defined in:
lib/test_performance.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ PerformanceData

Returns a new instance of PerformanceData.



6
7
8
# File 'lib/test_performance.rb', line 6

def initialize(data)
  @data = data
end

Instance Method Details

#mappingObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/test_performance.rb', line 10

def mapping
  hash = {}
  @data.each_key do |key|
    next if key == '__fxdriver_unwrapped'

    hash[key.to_sym] = {}

    next unless @data[key].respond_to? :each

    # BREAK OUT ALL IN THIS LOOP INTO METHOD?
    # WOULD HAVE TO PASS hash AND key.
    # WOULD HAVE TO RETURN hash.
    data_mapper(hash, key)
    # @data[key].each do |k, v|
    #  next if k == '__fxdriver_unwrapped'
    #  hash[key.to_sym][underscored(k).to_sym] = v
    # end
  end

  hash[:summary] = {}

  gather_summary_metrics(hash)

  OpenStruct.new(hash)
end