Hi,
Suppose I have written the below code:
class Foo
def show
p “Good”
end
end
Now is it possible in future to re-open the “show” method again to add
some new logic,once the class Foo
has been defined ?
Hi,
Suppose I have written the below code:
class Foo
def show
p “Good”
end
end
Now is it possible in future to re-open the “show” method again to add
some new logic,once the class Foo
has been defined ?
look for alias and alias_method
Hello Xavier,
yes, it is possible. There are three options you have, depending on what
you want:
Kind regards,
Calvin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs