Class: RemoteGem

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/rubygems_plugin.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ RemoteGem

Returns a new instance of RemoteGem.



13
14
15
16
17
# File 'lib/rubygems_plugin.rb', line 13

def initialize(hash)
  hash.each do |key, value|
    __send__("#{key}=", value)
  end
end

Instance Attribute Details

#authorsObject

Returns the value of attribute authors.



5
6
7
# File 'lib/rubygems_plugin.rb', line 5

def authors
  @authors
end

#downloadsObject

Returns the value of attribute downloads.



5
6
7
# File 'lib/rubygems_plugin.rb', line 5

def downloads
  @downloads
end

#infoObject

Returns the value of attribute info.



5
6
7
# File 'lib/rubygems_plugin.rb', line 5

def info
  @info
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/rubygems_plugin.rb', line 5

def name
  @name
end

#rubyforge_projectObject

Returns the value of attribute rubyforge_project.



5
6
7
# File 'lib/rubygems_plugin.rb', line 5

def rubyforge_project
  @rubyforge_project
end

#versionObject

Returns the value of attribute version.



5
6
7
# File 'lib/rubygems_plugin.rb', line 5

def version
  @version
end

Class Method Details

.info_for(name) ⇒ Object



8
9
10
11
# File 'lib/rubygems_plugin.rb', line 8

def self.info_for(name)
  data = get("http://gemcutter.org/api/v1/gems/#{name}.json")
  data.code == 404 ? nil : new(data)
end