I am learning Ruby.  It is my understanding that when we "override" a
method we *replace* the method in the super class with the new method.
In playing around, I discovered the mechanism illustrated in the code
below for *re-shaping* the result of the code in a super-class method.
I'm wondering if this technique is in common usage; and, if so, does it
have a name?  (I know that it's not, "overriding".  What is it?)

class Ace_high
  def suit()
    %w(2 3 4 5 6 7 8 9 10 J Q K A)
  end
end

 class Duce_high < Ace_high
   def suit()
     super().reverse
   end
 end

 clubs=Duce_high.new()
 puts(clubs.suit().inspect())

Thanks for any input.  BTW, is there some special procedure that I
should follow in posting code fragments?  Thanks.

       ... doug

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