Comment

Comment by hashmal

This is the most relevant use of `to_s` in this class indeed. One could imagine additional methods like:

    def bump_minor
      self.class.new(major, minor + 1, patch)
    end
(although I'm not sure why it would be useful in that particular case, it's just an example of how you can build new objects out of existing ones without having to mutate them)
parent hashmal 1 year ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton