Class: Gems::V2::Client
- Inherits:
-
Object
- Object
- Gems::V2::Client
- Includes:
- Request
- Defined in:
- lib/gems/v2/client.rb
Instance Method Summary collapse
-
#info(gem_name, version) ⇒ Hash
Returns information about the given gem for a sepcific version.
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from Request
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
12 13 14 15 16 17 |
# File 'lib/gems/v2/client.rb', line 12 def initialize( = {}) = Gems..merge() Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", [key]) end end |
Instance Method Details
#info(gem_name, version) ⇒ Hash
Returns information about the given gem for a sepcific version
27 28 29 30 31 32 |
# 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 |