class

Song

Inherits Reference < Object

Create a class

Constructors

new(title : String, artist : String)

Constructors must be called "initialize"

Source

Instance methods

==(other : self)

You can overload some operators

Source
artist
Source
artist=(artist : String)
Source
title

Classes can have properties. This is one of the few places where Crystal forces you to explicitly set types! Properties are accessed internally by prepending @. You'll see it used below.

Source
title=(title : String)

Classes can have properties. This is one of the few places where Crystal forces you to explicitly set types! Properties are accessed internally by prepending @. You'll see it used below.

Source