Sha256: f158a4a67dc52a4ec04c0211b0d9d5c6436e2ac2faffc9ded6d749ccb14ad03d

Contents?: true

Size: 390 Bytes

Versions: 1

Compression:

Stored size: 390 Bytes

Contents

class DateCombo
  attr_reader :date, :devs

  def initialize(date, *devs)
    @date, @devs = date, devs
  end

  def to_s
    if date.nil?
      "#{devs.join ', '}: not yet"
    else
      "#{devs.join ', '}: #{date}"
    end
  end

  def <=>(other)
    if date && other.date
      date <=> other.date
    elsif date
      1
    elsif other.date
      -1
    else
      0
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pair_see-0.1.0 lib/pair_see/date_combo.rb