Added type and type= for LmProxy in the ruby bindings
authorMikael Hallendal <micke@imendio.com>
Thu, 10 Apr 2008 14:57:41 +0200
changeset 377 52b0968e0235
parent 376 d54d6310c136
child 378 f757ef1a9d72
Added type and type= for LmProxy in the ruby bindings
bindings/ruby/rblm-proxy.c
--- a/bindings/ruby/rblm-proxy.c	Thu Apr 10 14:36:19 2008 +0200
+++ b/bindings/ruby/rblm-proxy.c	Thu Apr 10 14:57:41 2008 +0200
@@ -57,6 +57,24 @@
 	return self;
 }
 
+VALUE
+proxy_get_type (VALUE self)
+{
+	LmProxy *proxy = rb_lm_proxy_from_ruby_object (self);
+
+	return INT2FIX (lm_proxy_get_type (proxy));
+}
+
+VALUE
+proxy_set_type (VALUE self, VALUE type)
+{
+	LmProxy *proxy = rb_lm_proxy_from_ruby_object (self);
+
+	lm_proxy_set_type (proxy, FIX2INT (type));
+
+	return Qnil;
+}
+
 extern void
 Init_lm_proxy (VALUE lm_mLM)
 {
@@ -65,5 +83,7 @@
 	rb_define_alloc_func (lm_cProxy, proxy_allocate);
 
 	rb_define_method (lm_cProxy, "initialize", proxy_initialize, -1);
+	rb_define_method (lm_cProxy, "type", proxy_get_type, 0);
+	rb_define_method (lm_cProxy, "type=", proxy_set_type, 1);
 }