Class: SimpleCov::Formatter::MultiFormatter

### Home Classes Methods

### In Files

- lib/simplecov/formatter/multi_formatter.rb

### Parent

Object

### Methods

- ::[]
- #format
- #formatters

### Class/Module Index

Quicksearch

- SimpleCov
- SimpleCov::ArrayFilter
- SimpleCov::ArrayMergeHelper
- SimpleCov::BlockFilter
- SimpleCov::CommandGuesser
- SimpleCov::Configuration
- SimpleCov::ExitCodes
- SimpleCov::FileList
- SimpleCov::Filter
- SimpleCov::Formatter
- SimpleCov::Formatter::MultiFormatter
- SimpleCov::Formatter::SimpleFormatter
- SimpleCov::HashMergeHelper
- SimpleCov::LastRun
- SimpleCov::Profiles
- SimpleCov::Railtie
- SimpleCov::Result
- SimpleCov::ResultMerger
- SimpleCov::SourceFile
- SimpleCov::SourceFile::Line
- SimpleCov::StringFilter
- SimpleCov::VERSION
- Coverage

No matching classes.

# SimpleCov::Formatter::MultiFormatter

### Public Class Methods

[](*args) click to toggle source

    # File lib/simplecov/formatter/multi_formatter.rb, line 4
    def self.[](*args)
      Class.new(self) do
        define_method :formatters do
          @formatters ||= args
        end
      end
    end

### Public Instance Methods

format(result) click to toggle source

    # File lib/simplecov/formatter/multi_formatter.rb, line 12
    def format(result)
      formatters.map do |formatter|
        begin
          formatter.new.format(result)
        rescue => e
          STDERR.puts("Formatter #{formatter} failed with #{e.class}: #{e.message} (#{e.backtrace.first})")
          nil
        end
      end
    end

formatters() click to toggle source

    # File lib/simplecov/formatter/multi_formatter.rb, line 23
    def formatters
      @formatters ||= []
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.