Does the Crystal programming language have an equivalent to Ruby's attribute accessor methods? More specifically, does Crystal have equivalents to the following?
attr_accessorattr_readerattr_writer
?
Does the Crystal programming language have an equivalent to Ruby's attribute accessor methods? More specifically, does Crystal have equivalents to the following?
attr_accessorattr_readerattr_writer?
Copyright © 2021 Jogjafile Inc.
Yes, they're defined as macro.
Basically:
Example
is equal to
For more details see the Reference