How to access a (shadowed) global function in ruby.
- by yngvedh
Hi,
I was wondering how to access a global function fn in ruby from a class which also defined a method fn. I have made a workaround by aliasing the function like so:
def fn
end
class Bar
alias global_fn fn
def fn
# how to access the global fn here without the alias
global_fn
end
end
I'm looking for something along the lines of c++'s :: to access global scope but I can't seem to locate any information about it. I guess I don't know specifically what I'm looking for.