I need to create a client library to access a REST-based web service via HTTPS.
Not being overly familiar with Java, I would like to do this in Ruby, and then compile to a jar.
The payload I will send will be (in JSON) something like:
{
"api-token": "12345",
"org_number": 5,
"name": "ABC corp",
"users": {
"employee_number": 1,
"name": "bob jones",
"email": "[email protected]"
}
}
I assume the client library will need to:
- Initialize a new API interface instance with API token
- Give the instance organization information and set of users
- Tell the instance to serialize the organization and users to JSON, and POST to the webservice /org/new
So my question is:
- How do I structure my Ruby classes to produce an interface a Java programmer will be comfortable with (something like http://twitter4j.org/en/code-examples.html for example)
Have you considered JRuby?
https://github.com/jruby/jruby/wiki