Alexander Miles Alexander Miles - 1 year ago 55
Ruby Question

How to explicitly reference core classes in Ruby?

I'm working with Chef, and I have run into a situation where I need to use the Ruby

class method. Problem is, Chef overloads the core class with
when executing code within a
resource. How can one explicitly reference the core namespace File class?

Answer Source

Prepend the class name with ::, i.e., ::File.