[Ironruby-core] calling non class methods from C#

Ivan Porto Carrero ivan at flanders.co.nz
Thu Oct 1 09:31:01 EDT 2009


class TheExample
def output
  "Hello World"
end

end

var operations = Engine.CreateOperations();

Engine.ExecuteFile(/path/to/example.rb);

var instance = operations.CreateInstance();
var result = operations.InvokeMember(instance, "output");


---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero
Blog: http://flanders.co.nz
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)



On Thu, Oct 1, 2009 at 2:58 PM, Eelco Henderichs <lists at ruby-forum.com>wrote:

> Dear users,
>
> I have found how to invoke class methods and use its result in the C#
> application.
>
> However I can't seem to find how to invoke methodes located outside of a
> class. So I started wondering if this is at all possible. If it is, I
> would like to know how.
>
> Thanks in advance
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20091001/cd851d25/attachment.html>


More information about the Ironruby-core mailing list