class Gems::V2::Client
Public Class Methods
# File lib/gems/v2/client.rb, line 12 def initialize(options = {}) options = Gems.options.merge(options) Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", options[key]) end end
Public Instance Methods
Returns information about the given gem for a sepcific version
@authenticated false @param gem_name [String] The name of a gem. @param version [String] The requested version of the gem. @return [Hash] @example
Gems::V2.info 'rails', '7.0.6'
# File lib/gems/v2/client.rb, line 27 def info(gem_name, version) response = get("/api/v2/rubygems/#{gem_name}/versions/#{version}.json") JSON.parse(response) rescue JSON::ParserError {} end