Sha256: f8195b0871c4587ea9434b380bb709865904fd76e80357a3cffcf874c650b326
Contents?: true
Size: 492 Bytes
Versions: 27
Compression:
Stored size: 492 Bytes
Contents
# frozen_string_literal: true module Spandx module Core class Score include Comparable attr_reader :score, :item def initialize(score, item) update(score || 0.0, item) end def update(score, item) @score = score @item = item end def empty? score.nil? || item.nil? end def <=>(other) score <=> other.score end def to_s "#{score}: #{item}" end end end end
Version data entries
27 entries across 27 versions & 1 rubygems