Sha256: cfa572db27f51f3d5fea331fd07600c8e164a6c174e976f385e5f2304e4f3c83

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

module Coco

  # Contextual information for ERB template, representing index.html.
  #
  class IndexContext

    # Public: Initialize an IndexContext for the index file in the HTML
    # report.
    #
    # title     - The String title for the report.
    # all       - Array of subarrays. Each subarray is:
    #             [
    #               Fixnum coverage percentage,
    #               String formatted filename (HTML ready),
    #               String real filename
    #             ]
    # uncovered - Array of String filenames. The filenames are already
    #             formatted, ready to be display in an HTML file.
    # summary   - A Summary object.
    # threshold - Fixnum.
    #
    def initialize(title, all, uncovered, summary, threshold)
      @title = title
      @covered, @greens = all.partition { |file| file.first < threshold }
      @uncovered = uncovered
      @summary = summary
    end

    # Public: Get the object's binding.
    #
    # Returns Binding.
    #
    def variables
      binding
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coco-0.15.0 lib/coco/formatter/index_context.rb
coco-0.14.0 lib/coco/formatter/index_context.rb