Reputation: 803
How can I call super class method within class like:
class A
def foo
puts "lol"
end
end
class B < A
foo
end
Upvotes: 1
Views: 112
Reputation: 211580
You're trying to call an instance method from within the context of a class. This is not valid.
What would work:
class A
def self.foo
puts "lol"
end
end
class B < A
foo
end
Upvotes: 4