Ruby on Rails Friday, December 2, 2011

On Dec 2, 12:42 pm, Alexey Muranov <li...@ruby-forum.com> wrote:
> Frederick Cheung wrote in post #1034631:
>
>
>   class_attribute :fixture_class_names

The implementation is a bit different but the no-no on mutating the
blah.fixture_class_names is the same
>
> Didn't you mean D < C < B < A ?
>
yes :-)

A simpler example in which merge! and merge= wouldn't be the same
would be

class Foo
def self.bar
@bar.dup #prevent people mutating me!
end

def self.bar=(value)
@bar = value
end
end

Clearly Foo.bar.merge!(...) will not accomplish much here

Fred
> Alexey.
>
> --
> Posted viahttp://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment