class Rubyist::Gem
Attributes
homepage_uri[R]
info[R]
name[R]
project_uri[R]
Public Class Methods
new(hash)
click to toggle source
# File lib/rubyist.rb, line 40 def initialize hash @name, @info, @homepage_uri, @project_uri = %w[name info homepage_uri project_uri].map { |k| hash[k] } end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/rubyist.rb, line 45 def <=>(other) name <=> other.name end
total_downloads()
click to toggle source
# File lib/rubyist.rb, line 53 def total_downloads versions.inject(0) { |sum, v| sum + v.downloads } end
versions()
click to toggle source
# File lib/rubyist.rb, line 49 def versions @versions ||= Gems.versions(name).map { |v| Version.new v } end