summaryrefslogtreecommitdiff
path: root/ruby/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-03-01 15:12:26 +0100
committerJose <jose@zeroc.com>2016-03-01 15:12:26 +0100
commit1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd (patch)
tree38929143a6575d23e4438e590a20f525a829e194 /ruby/src
parentFix LMDB nuget package version (diff)
parentIce::identityToString/Ice::stringToIdentity php/ruby/python implementations (diff)
downloadice-1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd.tar.bz2
ice-1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd.tar.xz
ice-1419f188bf7d06ba0131cfd94a82f5d43ec0c7dd.zip
Merge remote-tracking branch 'origin/3.6'
Diffstat (limited to 'ruby/src')
-rw-r--r--ruby/src/IceRuby/Communicator.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/ruby/src/IceRuby/Communicator.cpp b/ruby/src/IceRuby/Communicator.cpp
index f67f490a560..7d004229160 100644
--- a/ruby/src/IceRuby/Communicator.cpp
+++ b/ruby/src/IceRuby/Communicator.cpp
@@ -225,6 +225,34 @@ IceRuby_initialize(int argc, VALUE* argv, VALUE self)
extern "C"
VALUE
+IceRuby_stringToIdentity(VALUE self, VALUE str)
+{
+ ICE_RUBY_TRY
+ {
+ string s = getString(str);
+ Ice::Identity ident = Ice::stringToIdentity(s);
+ return createIdentity(ident);
+ }
+ ICE_RUBY_CATCH
+ return Qnil;
+}
+
+extern "C"
+VALUE
+IceRuby_identityToString(VALUE self, VALUE id)
+{
+ ICE_RUBY_TRY
+ {
+ Ice::Identity ident = getIdentity(id);
+ string str = Ice::identityToString(ident);
+ return createString(str);
+ }
+ ICE_RUBY_CATCH
+ return Qnil;
+}
+
+extern "C"
+VALUE
IceRuby_Communicator_destroy(VALUE self)
{
Ice::CommunicatorPtr p = getCommunicator(self);
@@ -574,6 +602,8 @@ void
IceRuby::initCommunicator(VALUE iceModule)
{
rb_define_module_function(iceModule, "initialize", CAST_METHOD(IceRuby_initialize), -1);
+ rb_define_module_function(iceModule, "identityToString", CAST_METHOD(IceRuby_identityToString), 1);
+ rb_define_module_function(iceModule, "stringToIdentity", CAST_METHOD(IceRuby_stringToIdentity), 1);
_communicatorClass = rb_define_class_under(iceModule, "CommunicatorI", rb_cObject);
rb_define_method(_communicatorClass, "destroy", CAST_METHOD(IceRuby_Communicator_destroy), 0);