Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Ruby counter-example would be even better if it used `Struct` instead of a bare Class: https://ruby-doc.org/core/Struct.html

e.g.

  User = Struct.new(:email, :first_name, :last_name)
or to specify them in any order via kw args:

  User = Struct.new(:email, :first_name, :last_name, keyword_init=true)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: