class GitTrend::Formatter
Public Class Methods
new(key)
click to toggle source
# File lib/git_trend/formatter.rb, line 3 def initialize(key) @formatter = formatter_class(key).new end
Public Instance Methods
print(projects, options = nil)
click to toggle source
# File lib/git_trend/formatter.rb, line 7 def print(projects, options = nil) @formatter.print(projects, options) end
print_languages(languages)
click to toggle source
# File lib/git_trend/formatter.rb, line 11 def print_languages(languages) @formatter.print_languages(languages) end
Private Instance Methods
formatter_class(key)
click to toggle source
# File lib/git_trend/formatter.rb, line 16 def formatter_class(key) case key when "j", "json" then Formatters::JsonFormatter else Formatters::TextFormatter end end