app/value_objects/results_variant.rb
def to_date
    case self
    when NEVER_SPENT
      Date::Infinity.new
    when INDEFINITE
      # absurdly in the future, but sooner than "infinity"
      Date.new(2049, 1, 1)
    end
  end
# Needed so we are able to do ranges and compare dates with special variants
Needed so we are able to do ranges and compare dates with special variants
Needed so we are able to do ranges and compare dates with special variants
def to_date
    case self
    when NEVER_SPENT
      Date::Infinity.new
    when INDEFINITE
      Date.new(2049, 1, 1)
    end
  end
def to_date case self when NEVER_SPENT Date :: Infinity . new when INDEFINITE Date . new ( 2049 , 1 , 1 ) end end
Needed so we are able to do ranges and compare dates with special variants
Needed so we are able to do ranges and compare dates with special variants
# absurdly in the future, but sooner than "infinity"