ruby.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
If you are interested in the Ruby programming language, come join us! Tell us about yourself when signing up. If you just want to join Mastodon, another server will be a better place for you.

Administered by:

Server stats:

1K
active users

postmodern

I wonder if it's possible to sub-class the Symbol class in order to override the <=> operator method to create a sub-set of Symbols that have a custom order/priority:

class VersionModifier < Symbol

ORDER = [:pre, :alpha, :beta, :rc]

def <=>(other)
ORDER.fetch(to_sym) <=> ORDER.fetch(other.to_sym)
end

end

Still not sure how you'd handle initializing or mapping plain Symbols to your sub-classed Symbols.