Re: [Rails-core] Creating Proxy-containers with ActiveSupport's delegate, proposing return_value_of keyword argument

2013-08-15 Thread Aaron Patterson
On Tue, Aug 13, 2013 at 06:58:42PM -0400, Matt Jones wrote: On Aug 12, 2013, at 7:25 PM, Amiel Martin wrote: I like this idea and I would use it. My only suggestion would be to normally return a new instance of the proxy object. This makes it easier to use this feature with

Re: [Rails-core] Creating Proxy-containers with ActiveSupport's delegate, proposing return_value_of keyword argument

2013-08-13 Thread Matt Jones
On Aug 12, 2013, at 7:25 PM, Amiel Martin wrote: I like this idea and I would use it. My only suggestion would be to normally return a new instance of the proxy object. This makes it easier to use this feature with immutable objects. I know it would be possible to do this: class

[Rails-core] Creating Proxy-containers with ActiveSupport's delegate, proposing return_value_of keyword argument

2013-08-12 Thread Denis Redozubov
Hello guys! I'd like to propose new feature for ActiveSupport Module's delegate method. I've actually implemented it already and i want your opinion on this matter. Recently during my work hours, i was writing enumerable proxy-object to encapsulate some business-logic and i wanted it to mimic

Re: [Rails-core] Creating Proxy-containers with ActiveSupport's delegate, proposing return_value_of keyword argument

2013-08-12 Thread Amiel Martin
I like this idea and I would use it. My only suggestion would be to normally return a new instance of the proxy object. This makes it easier to use this feature with immutable objects. I know it would be possible to do this: class ProxyContainer Struct.new(:brands) delegate :select, to:

Re: [Rails-core] Creating Proxy-containers with ActiveSupport's delegate, proposing return_value_of keyword argument

2013-08-12 Thread Duncan Beevers
These types of APIs are typically referred to as Fluent Interfaces, so adopting that nomenclature seems appropriate. On Mon, Aug 12, 2013 at 4:25 PM, Amiel Martin am...@carnesmedia.com wrote: I like this idea and I would use it. My only suggestion would be to normally return a new instance