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?

···

--
Posted via http://www.ruby-forum.com/.

Jason Lillywhite wrote:

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?

require 'abbrev' # it's in the stdlib, not core

···

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Jason Lillywhite wrote:

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?

require 'abbrev'

Jason Lillywhite 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.

···

--
Posted via http://www.ruby-forum.com/\.

Tim Hunter 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!

···

--
Posted via http://www.ruby-forum.com/\.

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:

···

--
Posted via http://www.ruby-forum.com/\.

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

···

On Sat, Aug 15, 2009 at 6:10 AM, Tim Hunter<sastph@sas.com> wrote:

Is Array#abbrev depreciated?

require 'abbrev'