January 2019
Intermediate to advanced
246 pages
5h 23m
English
If you’ve done much object-oriented development, you’re familiar with classes. You might also have noticed, though, that the details of classes vary from language to language. In this chapter, you’ll see Crystal’s specific take on classes, and you’ll learn the ins and outs of working with classes. You’ll learn how to construct a class and a struct, how to use inheritance, and how to control visibility of methods. Along the way, you’ll master syntactic details.
In object-oriented code, methods don’t stand alone most of the time: they form the action part of a class, and they’re the only way to interact with objects. You should only find out the data part of an object (its internal state) by using methods. ...
Read now
Unlock full access