An abstract class is a class that has to be inherited. You can not instantiate an abstract class. By the same token and abstract method has to be implemented by child classes. When you define an abstract method you don’t put any logic in it, you just define the parameters that the method is expected to receive, and possibly the expected response type. For instance
abstract class Foo
abstract def bar(text : String) : Array(String)
end
def Baz < Foo
def bar(text : String)
string.split(" ")
end
end
def Boof < Foo
# This will not compile because it doesn't implement `#bar`
end
def fun(foo : Foo)
pp foo.bar # This would work because the class `Foo` has a `#bar` method
end