Sha256: 55e7da43e006b275321f488007fb3692462faa281424bd77c913acc83635a4b0

Contents?: true

Size: 895 Bytes

Versions: 8

Compression:

Stored size: 895 Bytes

Contents

require_relative "../base_formatter"

class ResumeArrayFormatter < BaseFormatter
  def initialize(report)
    super(report)
    @data = {}
  end

  def process(options = {})
    build_data(options)
    w @data.to_s # Write data into ouput file
    deinit
  end

  def build_data(options)
    build_initial_data
    build_cases_data
    build_final_data
    build_hof_data
  end

  def build_initial_data
    head = {}
    @head.each { |key, value| head[key] = value }
    @data[:config] = head
  end

  def build_cases_data
    @data[:cases] = @lines
  end

  def build_final_data
    tail = {}
    @tail.each { |key, value| tail[key] = value }
    @data[:results] = tail
  end

  def build_hof_data
    app = Application.instance
    fame = {}
    if app.options[:case_number] > 2
      app.hall_of_fame.each { |line| fame[line[0]] = line[1] }
    end
    @data[:hall_of_fame] = fame
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
teuton-2.6.0 lib/teuton/report/formatter/resume/array.rb
teuton-2.5.0 lib/teuton/report/formatter/resume/array.rb
teuton-2.4.5 lib/teuton/report/formatter/resume/array.rb
teuton-2.4.4 lib/teuton/report/formatter/resume/array.rb
teuton-2.4.3 lib/teuton/report/formatter/resume/array.rb
teuton-2.4.2 lib/teuton/report/formatter/resume/array.rb
teuton-2.4.1 lib/teuton/report/formatter/resume/array.rb
teuton-2.4.0 lib/teuton/report/formatter/resume/array.rb