Sha256: 99a8a6bd0721bf3bd57df6a0e8d82f92f2499d1bd9d1828d254dc2b1a03fd59c

Contents?: true

Size: 477 Bytes

Versions: 1

Compression:

Stored size: 477 Bytes

Contents

module GitTrend
  class Formatter
    def initialize(key)
      @formatter = formatter_class(key).new
    end

    def print(projects, options = nil)
      @formatter.print(projects, options)
    end

    def print_languages(languages)
      @formatter.print_languages(languages)
    end

    private

      def formatter_class(key)
        case key
        when "j", "json" then Formatters::JsonFormatter
        else Formatters::TextFormatter
        end
      end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git-trend-1.4.0 lib/git_trend/formatter.rb