Dave Copeland :ruby: on Nostr: The two things I like about this gem (that I created some or most of a long time ago ...
The two things I like about this gem (that I created some or most of a long time ago :) that Data does not have are:
• If a field ends in a “?”, e.g. :new?, then it will be coerced into a boolean, e.g. active: nil will cause active? to return false
• If a field is a single-element array with a symbol, it will be coerced into an array—never nil.
I'm not sure these are strong-enough reasons to adopt it over Data, but I liked those features :)
https://ruby.social/@soulcutter/114066641156424488Published at
2025-02-25 21:31:58Event JSON
{
"id": "4b47d01147f76aff7b3f5c8b39fca08749e610d5b43a8dbb64976c443c20c445",
"pubkey": "0a98fcc74400896d68beecfb32da230c656db6fc7ab43c4228b7755377d294f2",
"created_at": 1740519118,
"kind": 1,
"tags": [
[
"proxy",
"https://ruby.social/users/davetron5000/statuses/114066660954774947",
"activitypub"
]
],
"content": "The two things I like about this gem (that I created some or most of a long time ago :) that Data does not have are:\n\n• If a field ends in a “?”, e.g. :new?, then it will be coerced into a boolean, e.g. active: nil will cause active? to return false\n• If a field is a single-element array with a symbol, it will be coerced into an array—never nil.\n\nI'm not sure these are strong-enough reasons to adopt it over Data, but I liked those features :)\nhttps://ruby.social/@soulcutter/114066641156424488",
"sig": "bad9e528293480c20f9f3cf01b263606af60e551c325bc58e4a8c7cdb3136d5e9d8e4f0b884d1fb63f4860734eeea8f600fafe7eb2f50270b878d71ebec1e4de"
}