What is Nostr?
Dave Copeland :ruby: /
npub1p2v…jyrl
2025-02-13 17:40:14
in reply to nevent1q…yzqe

Dave Copeland :ruby: on Nostr: nprofile1q…szr50 Yeah, the idea of "return nil if the arg is nil” is to contain ...

nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpqd6t07avcds2swp4xrmel283zrad4x5q2x6a6arncnwhf40w20vaqnszr50 (nprofile…zr50) Yeah, the idea of "return nil if the arg is nil” is to contain nils and not let them leak into object state, i.e. if a header is a name and a value, the name should never be nil, thus no Header should ever be created with a nil name.

Depending on context, "return nil" could also be "blow up”, but same general structure works.

It would be cool if Ruby allowed TypeName(…) to be auto-defined as a conversion for types you define.
Author Public Key
npub1p2v0e36yqzyk6697anan9k3rp3jkmdhu026rcs3gka64xa7jjneq5cjyrl