Hello
Thank you all for your help and I have to say that I am sorry also, I
missed the other replies where you came right out and told me how to do it,
for some reason I only saw the one that mapped the DateTime to the Time
object, you all provided very good answers to my question and I really
Hi
Should I be able to call out to a C# method with this release that
returns a dynamic and access it's return value?
public class Modifier
{
public dynamic Modify(IPropertyPolicyInfo info)
{
dynamic obj = new ExpandoObject();
obj.Name = info.AccountShortName;
obj.Address = new Expando
Hi all,
Is there any way to declare a C# static method accessible from IronRuby
as a regular Ruby method?
like:
public class MyCSharpClass {
public static string mymethod(string test) {
return test + "yes";
}
}
in ironruby:
puts mymethod("test")
--
Posted via http://www.ruby-forum.com/.
__
I guess you can do that in two ways.
The first one is to add a statement in Ruby code:
class Object
def mymethod(str)
MyCSharpClass.mymethod(str)
end
end
Or you can write an IronRuby extension in C# and make that class extend the
Object class.
Shay.
--
You can only reach it by adding the class as receiver.
but you can use method missing as a dispatcher:
alias :old_mm :method_missing
def method_missing(method_name, *args, &block)
return MyCSharpClass.send(method_name, *args) if MyCSharpClass.respond_to?
method_name
old_mn method_name, *arg
FYI, we’re thinking about allowing you to use “include” with .NET types, which
will include it’s static methods. That would enable:
include MyCSharpClass
puts mymethod "foo"
IronPython already does this for import, so it seems like a good idea:
from MyCSharpClass import mymethod
print mymethod(
My 2c on the matter
I think Ruby on .NET is great and stuff like the clr_new, overloads etc are
a necessary evil to ease working with CLR classes.
But I do think that changing a basic construct like include will not be good
unless the other rubies also include it. The reason for it is you only use
Ivan Porto carrero wrote:
> You can only reach it by adding the class as receiver.
>
> but you can use method missing as a dispatcher:
>
> alias :old_mm :method_missing
> def method_missing(method_name, *args, &block)
>return MyCSharpClass.send(method_name, *args) if
> MyCSharpClass.respond_
> On a similar subject, is there a way to resolve dynamic variable at
> runtime? Like, a user type a variable that was not declared, but the DLR
> host is able to create on the fly an object for this variable and return
> it. Is it possible? Is "IDynamicMetaObjectProvider" and
> "IAttributesCol
On Fri, Nov 13, 2009 at 9:07 PM, Jimmy Schementi > wrote:
FYI, we’re thinking about allowing you to use “include” with .NET
types, which will include it’s static methods. That would enable:
I'd be very much in favour of this. A .NET static class full of static
methods always seemed like it
Thanks to casualjim in #ironruby, I figured out a way to do what I
needed, but would be interested to see if there is a more appropriate
solution:
I'm trying to use SMO to script objects from a SqlServer DB, using IR.
In particular, I am calling
Microsoft::SqlServer::Management::Smo::Scripter.Scr
> From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core-
> boun...@rubyforge.org] On Behalf Of Alexandre Mutel
> Sent: Friday, November 13, 2009 1:45 PM
> To: ironruby-core@rubyforge.org
> Subject: Re: [Ironruby-core] Calling a C# static from IronRuby
>
> > On a similar subject, is there
12 matches
Mail list logo