'How to call a non-class function from a class method?
I'm trying to call the sh method from FileUtils.
class A
def self.method
sh('echo hello')
end
end
def function
sh('echo hello')
end
function # this is fine
A.method # this gives an error
The error I get is
NoMethodError: undefined method 'sh' for A:Class
How can I change my method to be able to call the function?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
