[ruby-core:32670] Re: [Ruby-Feature#3897][Open] Pathname sub_ext! method

From: Nikolai Weibull <now@...>
Date: 2010-10-02 11:20:19 UTC
List: ruby-core #32670
On Sat, Oct 2, 2010 at 09:41, Semyon Perepelitsa <redmine@ruby-lang.org> wrote:
> Feature #3897: Pathname sub_ext! method
> http://redmine.ruby-lang.org/issues/show/3897
>
> Author: Semyon Perepelitsa
> Status: Open, Priority: Low
> Category: lib
>
> There is already sub_ext method for Pathname, but there is no sub_ext! to modify the object itself instead of returning a new one.

Pathname is a value object so having methods that modify it is, well,
rather a big no-no.

http://c2.com/cgi/wiki?ValueObject

(Note how the article uses strings as an example, which sadly aren’t
immutable in Ruby.)

In This Thread

Prev Next