Module: SimpleCov::JSON

### Home Classes Methods

### In Files

- lib/simplecov/json.rb

### Methods

- ::dump
- ::parse

### Class/Module Index

Quicksearch

- SimpleCov
- SimpleCov::Adapters
- SimpleCov::ArrayMergeHelper
- SimpleCov::BlockFilter
- SimpleCov::CommandGuesser
- SimpleCov::Configuration
- SimpleCov::CoverageDataError
- SimpleCov::ExitCodes
- SimpleCov::FileList
- SimpleCov::Filter
- SimpleCov::Formatter
- SimpleCov::Formatter::MultiFormatter
- SimpleCov::Formatter::SimpleFormatter
- SimpleCov::HashMergeHelper
- SimpleCov::JSON
- SimpleCov::LastRun
- SimpleCov::Railtie
- SimpleCov::Result
- SimpleCov::ResultMerger
- SimpleCov::SourceFile
- SimpleCov::SourceFile::Line
- SimpleCov::StringFilter

No matching classes.

# SimpleCov::JSON

### Public Class Methods

dump(string) click to toggle source

    # File lib/simplecov/json.rb, line 14
    def dump(string)
      if defined? ::JSON
        ::JSON.pretty_generate(string)
      else
        # Detect and use available MultiJson API - it changed in v1.3
        if MultiJson.respond_to?(:adapter)
          MultiJson.dump(string)
        else
          MultiJson.encode(string)
        end
      end
    end

parse(json) click to toggle source

    # File lib/simplecov/json.rb, line 5
    def parse(json)
      # Detect and use available MultiJson API - it changed in v1.3
      if MultiJson.respond_to?(:adapter)
        MultiJson.load(json)
      else
        MultiJson.decode(json)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.