ruby on rails - Override method with an empty one -


What is the emptify method in Ruby?

That is, in one sub-class, if I want to override a method with some method, then there is another syntax from this:

  class Adx xx [..a few ..] End and class B & LT; A def xx # dot notthing and end   

I would like to know if there is such a keyword ...

  class B & lt; A void_method: XX termination   

... because this code is clear for maintenance.

It is not, and it really does

  def xx There will be more keystrokes;   

However you can easily add this method to

  class A def self.void_method name define_method (name) {} end end   

Or you can add it to an object if you are going to use it in more places.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -