W3cubDocs

/Crystal 0.31

Everything is an object

In Crystal everything is an object. The definition of an object boils down to these points:

  • It has a type
  • It can respond to some methods

This is everything you can know about an object: its type and whether it responds to some method.

An object's internal state, if any, can only be queried by invoking methods.

To the extent possible under law, the persons who contributed to this workhave waived
all copyright and related or neighboring rights to this workby associating CC0 with it.
https://crystal-lang.org/docs/syntax_and_semantics/everything_is_an_object.html