rochefort/git-trend

View on GitHub
lib/git_trend/formatters/json_formatter.rb

Summary

Maintainability
A
0 mins
Test Coverage
C
71%
require "json"

module GitTrend::Formatters
  class JsonFormatter
    def print(projects, options) # rubocop:disable Lint/UnusedMethodArgument
      puts projects.map(&:to_h).to_json
    end

    def print_languages(languages)
      puts languages.to_json
    end
  end
end