[Ironruby-core] Attributes

Tomas Matousek Tomas.Matousek at microsoft.com
Wed Feb 18 21:31:58 EST 2009


We think in similar directions.

Tomas

From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards
Sent: Wednesday, February 18, 2009 5:18 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Attributes

Fair enough:
Here's my thoughts on what such a thing might look like:

module IMyService
    clr_attribute ServiceContractAttribute.new("blah")

    clr_attribute OperationContractAttribute.new, :on => "SomeMethod"
    def SomeMethod; end
end

Could also have similar methods which map from string to ClassName at runtime

clr_attr "ServiceContract"
clr_attr "OperationContract", :on => "SomeMethod"

Could also implement named parameters eg

clr_attr "ServiceContract", :name => "MyFancyContract"
clr_attr "OperationContract", :name => "CoolOperation", :on => "SomeMethod"


Hope this helps inspire :-)

On Thu, Feb 19, 2009 at 2:01 PM, Michael Letterle <michael.letterle at gmail.com<mailto:michael.letterle at gmail.com>> wrote:
AFAIK you can't yet.  It's one of those interop things that are on the back burner while language compatibility is worked on.  There's still alot of discussion needed about how to do this...
On Wed, Feb 18, 2009 at 7:20 PM, Orion Edwards <orion.edwards at gmail.com<mailto:orion.edwards at gmail.com>> wrote:
I'd like to mock up a WCF service using IronRuby.

This presents some stumbling blocks however, in that WCF ServiceContracts are defined by creating an Interface and then applying attributes to it.

Interface ~= Module in IronRuby, so that would probably be fine, but how can I apply attributes to the module and the methods it declares?
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org>
http://rubyforge.org/mailman/listinfo/ironruby-core



--
Michael Letterle
IronRuby MVP
http://blog.prokrams.com



_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org<mailto: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/20090218/e4011e3e/attachment-0001.html>


More information about the Ironruby-core mailing list