DEV Community

Discussion on: Value objects in Ruby

Collapse
 
codeandclay profile image
Oliver • Edited

Thank you. That had slipped from my radar. Yes, Comparable gives me <, <= etc... just by defining <==>:

  def <=>(other)
    to_i <=> other.to_i
  end
Enter fullscreen mode Exit fullscreen mode