Array#abbrev depreciated?

If you look at the core ruby doc, it says Array#abbrev will let you do
this:

%w{ car cone }.abbrev #=> { “ca” => “car”, “car” => “car”,
“co” => “cone”, “con” => cone",
“cone” => “cone” }

But if I try this in IRB, I get:

irb(main):002:0> %w{ car cone }.abbrev
NoMethodError: undefined method `abbrev’ for [“car”, “cone”]:Array
from (irb):2

Is Array#abbrev depreciated?

Jason L. wrote:

NoMethodError: undefined method `abbrev’ for [“car”, “cone”]:Array
from (irb):2

Is Array#abbrev depreciated?

require ‘abbrev’ # it’s in the stdlib, not core

Jason L. wrote:

NoMethodError: undefined method `abbrev’ for [“car”, “cone”]:Array
from (irb):2

Is Array#abbrev depreciated?

require ‘abbrev’

Jason L. wrote:

Is Array#abbrev depreciated?

Yes, ruby changed accountants, and the new accountants have decided to
depreciate abbrev over the next five years for a tax write off.

Tim H. wrote:

require ‘abbrev’

I didn’t realize that a class from the core library would have methods
from the standard library. I know ruby classes can be extended, but I
just didn’t expect it here.

Thanks!

7stud – wrote:

Yes, ruby changed accountants, and the new accountants have decided to
depreciate abbrev over the next five years for a tax write off.

oops. Deprecated. You can tell I’m new at this. :slight_smile:

On Sat, Aug 15, 2009 at 6:10 AM, Tim H.[email protected] wrote:

Is Array#abbrev depreciated?

require ‘abbrev’

I wish this would be obvious from rdoc/ri documentation.