Sha256: eff969754c50f80daa835771e2d80099e1c02afcabbaa1d04bea834cb6b53b10

Contents?: true

Size: 964 Bytes

Versions: 3

Compression:

Stored size: 964 Bytes

Contents

require 'restful_mapper'
require 'pp'

class Dependency
  include StructureMapper::Hash
  attribute name: String
  attribute requirements: String
end

class RubyGemInfo
  include StructureMapper::Hash
  attribute name: String
  attribute downloads: Fixnum
  attribute version: String
  attribute version_downloads: Fixnum
  attribute platform: String
  attribute authors: String
  attribute info: String
  attribute licenses: []
  attribute project_uri: String
  attribute gem_uri: String
  attribute homepage_uri: String
  attribute wiki_uri: String
  attribute documentation_uri: String
  attribute mailing_list_uri: String
  attribute source_code_uri: String
  attribute bug_tracker_uri: String
  attribute dependencies: {String => [Dependency]}
end

class RubyGemsService < RestfulMapper::Service
  
  base_url 'https://rubygems.org/api/v1'

  get :gems do
    path 'gems/rails.json', {}
    responses 200 => RubyGemInfo
  end
end


pp RubyGemsService.gems({})

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
restful_mapper-0.0.3 examples/rubygems.rb
restful_mapper-0.0.2 examples/rubygems.rb
restful_mapper-0.0.1 examples/rubygems.rb