On Monday, July 9, 2012 12:10:07 PM UTC-7, Nicolás Sanguinetti wrote:
dup doesn't take arguments because in ruby dup doesn't take arguments. It
wouldn't make sense to break the semantics of ruby just for this, IMO.
I had not considered that. On the other hand:
* it's not like dup calls
On Tue, Jul 10, 2012 at 12:36 PM, Kurt Werle k...@circlew.org wrote:
On Monday, July 9, 2012 12:10:07 PM UTC-7, Nicolás Sanguinetti wrote:
dup doesn't take arguments because in ruby dup doesn't take arguments. It
wouldn't make sense to break the semantics of ruby just for this, IMO.
I had
dup takes no args
create and new both take the same args, and create can take a block
It seems to me it would be more consistent (and convenient) if I could do
some_record.dup(attributes_i_want_to_change) do |dup_record|
dup_record.attribute = some_value
Sounds nice.
On Mon, Jul 9, 2012 at 12:23 PM, Kurt Werle k...@circlew.org wrote:
dup takes no args
create and new both take the same args, and create can take a block
It seems to me it would be more consistent (and convenient) if I could do
some_record.dup(attributes_i_want_to_change) do
Not only breaking Ruby semantics, but you can get what you want with this:
some_record.dup.tap do |dup_record|
dup_record.attribute = some_value
self.relationship.dup(reverse_relationship: dup_record)
end
--
You received this message because you are subscribed to the Google Groups Ruby
on
What about initialize_dup?
El jul 9, 2012 2:11 p.m., Nicolas Sanguinetti godf...@gmail.com
escribió:
dup doesn't take arguments because in ruby dup doesn't take arguments. It
wouldn't make sense to break the semantics of ruby just for this, IMO.
Cheers,
-foca
On 09/07/2012, at 14:23,
On Mon, Jul 9, 2012 at 4:22 PM, Francesco Rodriguez
lrodriguezs...@gmail.com wrote:
What about initialize_dup?
What about it?
-f
El jul 9, 2012 2:11 p.m., Nicolas Sanguinetti godf...@gmail.com
escribió:
dup doesn't take arguments because in ruby dup doesn't take arguments. It
wouldn't