Forum: IronRuby Problem calling CLR method

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E1e2dd8c03c8e9e0680cfd802df0a04b?d=identicon&s=25 Alex 2k8 (alex_2k8)
on 2009-01-08 02:24
Hello,

I can't call the object's method, thought it exists.

My ruby script:

- - - - -
# Let's dump .Net methods
far.get_type.get_methods.each { |m| p m.name }

# Try to call 'RegisterTool' method
begin
  far.register_tool
rescue => err
  p err
end

begin
  far.RegisterTool
rescue => err
  p err
end
- - - - -

I get such output:

- - - - -
 ...
"RegisterFiler"
"RegisterTool"
 ...

#<NoMethodError: undefined method `register_tool' for
#<FarNet::Far:0x000005c>>
#<NoMethodError: undefined method `RegisterTool' for
#<FarNet::Far:0x000005c>>
- - - - -

Not sure if this matters, but 'far' variable is set by the script host
  scope.SetVariable("far", Far);

Thanks,
  - Alex
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2009-01-08 17:29
(Received via mailing list)
Could you sent source code for FarNet class (RegisterTool method
declaration)?

Tomas
E1e2dd8c03c8e9e0680cfd802df0a04b?d=identicon&s=25 Alex 2k8 (alex_2k8)
on 2009-01-08 17:49
E1e2dd8c03c8e9e0680cfd802df0a04b?d=identicon&s=25 Alex 2k8 (alex_2k8)
on 2009-01-08 18:06
Btw, IronPython can call same method:

http://farnet.googlecode.com/files/IronPythonFar.1.0.35.rar
 IronPythonFar\Scripts\calc.py

- - -
far.RegisterTool(ipy, "IronPython calculator", calc,
FarManager.ToolOptions.F11Menus)
- - -
This topic is locked and can not be replied to.