class GithubScouter::Printer
Public Class Methods
new(scouter)
click to toggle source
# File lib/github_scouter.rb, line 86 def initialize(scouter) @scouter = scouter end
Public Instance Methods
power()
click to toggle source
# File lib/github_scouter.rb, line 98 def power atk = @scouter.atk int = @scouter.int agi = @scouter.agi params = [atk,int,agi] puts "戦闘力: %d" % params.sum puts puts "攻撃力: %d 知力: %d すばやさ: %d" % params end
put()
click to toggle source
# File lib/github_scouter.rb, line 90 def put power puts "" repos_rank puts "" starred_rank end
rank(repos,label)
click to toggle source
# File lib/github_scouter.rb, line 116 def rank(repos,label) rank = Scouter.language_rank(repos) puts "# #{label} (#{repos.count})" puts "" rank[0..9].each_with_index do |(key,value),i| puts "#{i+1}. ".ljust(4) + key.ljust(20) + value.to_s end end
repos_rank()
click to toggle source
# File lib/github_scouter.rb, line 108 def repos_rank rank(@scouter.repos, "repositories") end
starred_rank()
click to toggle source
# File lib/github_scouter.rb, line 112 def starred_rank rank(@scouter.starred, "starred") end