Skip to content

metamolecular/chemcaster-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

101 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chemcaster Ruby API

This is the Ruby interface for the Chemcaster RESTful Web API. It consists of basic functionality needed to create applications using chemical structure registration, storage, imaging, and search.

Installation through the Ruby Gem hosted on GitHub is recommended:

# add GitHub to your local list of gem sources:
gem sources -a http://gems.github.com/

# install the gem:
gem install metamolecular-chemcaster
require 'rubygems'
require 'chemcaster'

service = Chemcaster::Service.connect 'username', 'password'

Because Chemcaster authenticates using SSL, you’ll need to make sure the Ruby HTTP library can find the root SSL certificates on your system. On Debian Linux systems, these files are found in /etc/ssl/certs. This is also the default location used by the Chemcaster Ruby Client.

To override the default SSL certificates path, pass the root_ca option to the connect method:

service = Chemcaster::Service.connect 'username', 'password',
  :root_ca => 'path/to/root_ssl_certs'

More information can be found here:

require 'rubygems'
require 'chemcaster'

service = Chemcaster::Service.connect 'username', 'password'
registries = service.registries
registries.size # => 3
registry = registries[0]
require 'rubygems'
require 'chemcaster'

Chemcaster::Service.connect 'username', 'password'

link = Chemcaster::Link.new 'name'=> 'foo',
  'uri' => 'https://chemcaster.com/registries/123456',
  'media_type' => 'application/vnd.com.chemcaster.Registry+json'
registry = link.get

Note: No assumptions should be made about Chemcaster URI layout. Once you receive a resource URI, you can expect it to work at any point in the future for random-access. But URI templates are unnecessary when accessing resources.

require 'rubygems'
require 'chemcaster'

service = Chemcaster::Service.connect 'username', 'password'
registries = service.registries

registries.create :name => 'CarboBlocks, Inc.'
require 'rubygems'
require 'chemcaster'

service = Chemcaster::Service.connect 'username', 'password'
registry = service.registries[0]
registry.update :name => 'CarboBlocks International, Inc.'

RDoc documentation is available at rdoc.info.

About

Ruby Interface for the Chemcaster Web Service Platform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages