I need to call a method before every static method called in rails.
is it possible
Example:
Class A
#Here a bunch of statements before every static method
def self.b
# some code related to b
end
def self.a
# some code related to a
end
end
when I call A.b then the output should be:
==========
bunch of statements before every static method and
code related to b
==========
Thanks in advance
Try this
class A
def self.hello
print "how are"
end
def self.before_stuff
print "you"
end
begin
print "hello,"
end
end
A.hello