Hey,

The Ruby integration is going forward. But, being a complete Ruby newbie 
I'm not sure what is the most Rubyish way to do the following.

If I have a Java mixin type "SomeMixin" that should be backed by Ruby 
then the user should create the file "SomeMixin.rb" in which there 
should be a Ruby class with the methods of the mixin type:
class SomeMixin
   def someMethod
     ...
   end
end
---

The question is: if the Ruby code wants to access other methods in the 
Composite, from other mixins, what is the best way to do this? I could 
do it by adding an implicit "this" variable which points to the 
Composite, like so:
class SomeMixin
   def someMethod
     x = @this.doOtherStuff
     @this.someProperty = x
   end
end
---
Here it is reasonably explicit that the invoked methods and properties 
is not in the Ruby "mixin" itself but rather needs to be provided elsewhere.

Does this seem ok? Any other suggestions?

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to