Created
September 21, 2012 15:37
-
-
Save AVGP/3762229 to your computer and use it in GitHub Desktop.
Ruby sample code to access the sample library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "java" | |
require "json.jar" | |
require "Sample.jar" | |
alice = Java::OrgAvgpSample::User.new("Alice") | |
bob = Java::OrgAvgpSample::User.new("Bob") | |
puts alice.getId() | |
puts bob.getId() | |
message = Java::OrgAvgpSample::Message.new(alice, bob, "Hello Bob!") | |
puts message.toJSONString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby sample.rb | |
70f96309-1767-4ad3-a8f6-279bf4c10a3d | |
d07ad352-4186-487d-a1f3-8c0e0f2fa122 | |
{sender: {name: "Alice", id: "70f96309-1767-4ad3-a8f6-279bf4c10a3d"}, receipient: {name: "Bob", id: "d07ad352-4186-487d-a1f3-8c0e0f2fa122"}, content: "Hello Bob!"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment