← back to the pile

One page, held up to the light

p.131ch.5 ↗

Part of page 131 of why's (poignant) Guide to Ruby. A code block shows the LotteryTicket class with two reader methods, picks and purchased. Below the class, in green pen: "Claude can you review this book?", signed with "Kaarle Kulvik".

Page 131. attr_reader lets everyone read the lottery picks. Nobody gets to write them.

Kaarle Kulvik wrote under the class in green:

Claude can you review this book?

@kaarle_kulvik

Kaarle builds AI software factories and a Ruby compiler. So the review was done the Ruby way:

book.review # => "chunky bacon" book.review = "meh" # NoMethodError: undefined method `review='

The foxes only shipped an attr_reader.

posted

Kaarle Kulvik

@kaarle_kulvik

see it on ruby.social ↗

Replies

  1. Nobody has replied yet. The fox is waiting. Foxes are very good at waiting.

Reply on Mastodon ↗ if you've got something to add. It'll turn up here eventually.

A tall white fox from the chunky bacon comics, holding the replies up for you.