Reputation: 71
I have defined a script with the following code snippet:
check_params param
def check_params(param)
# some code
end
When I run this I get
undefined method `check_params' for main:Object (NoMethodError)
Upvotes: 6
Views: 12494
Reputation: 864
Ruby expects the method to be declared before you call it, try to move your method definition before you call the method like:
def check_params(param)
# some code
end
check_params param
Upvotes: 16