--00151758888435fd9304918874e8
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Sep 30, 2010 at 4:06 PM, Brian Candler <b.candler / pobox.com> wrote:

> Josh Cheek wrote:
> >> But is there a way to call the original method instead of just quitting
> >> out?
> >>
> > The super keyword does this
>
> No it doesn't; not if you redefine a method in the same class.
>
> You need to use alias.
>
> class String
>  alias :orig_length :length
>  def length
>    puts "Whee!"
>    orig_length
>  end
> end
> puts "abc".length
> --
> Posted via http://www.ruby-forum.com/.
>
>
Whoops. Thanks, my brain swapped override and overwrite.

--00151758888435fd9304918874e8--