This gem allow discover and use modgen's API.
Ruby JavaScript
Latest commit 3591078 Jul 16, 2013 @ondra-m Update README.md
Failed to load latest commit information.
lib
spec
test_api
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
modgen.gemspec

README.md

Modgen API klient

Instalation

Install

gem install modgen

Bundler

gem 'modgen'

Ruby

require 'modgen'

Configuration

Modgen.configure do
  client_id "1"
end

# ------------ or ------------

Modgen.config.client_id = "1"

List of all available conf.

key example and description
oauth2.client_id Id of client generated by API server.

e.g. egt45e5t5trh54rth5rth54rt5h4r5t4h5rt4h
oauth2.client_secret Secret key generated by API server.

e.g. 4546846846th468684684t684hthrthrt6h871rh78888
oauth2.redirect_uri Address of web page where request will be redirected for gain access code.

e.g http://localhost/oauth2callback

Usage

First you must discovery API. For displaying all available versions.

Discovery

Modgen::Discovery.versions

Details of specific version. If version is nil Modgen show preffered version.

Modgen::Discovery.version(version)

Discover specific version. If version is nil Modgen discover preffered version.

Modgen::Discovery.discover(version)

API details

Modgen::API.api.name
               .description
               .version
               .created_at
               .updated_at
               .base_url

API request

Modgen::API.dataset.get(id: 1)

Test

First start testing API in /test_api and than.

rake