class Prj::DirWithScore

Attributes

dir[RW]
score[RW]

Public Class Methods

new(dir, score) click to toggle source
# File lib/prj/dir_with_score.rb, line 13
def initialize(dir, score)
  @dir, @score = dir, score
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/prj/dir_with_score.rb, line 17
def <=>(other)
  if score < other.score
    -1
  elsif score > other.score
    1
  else
    if length < other.length
      -1
    elsif  length > other.length
      1
    else
      0
    end
  end
end