Sha256: f7ee4693eceea4b098f033d8880cb43d0c22aa04c8c8f04fd214c79558068d71
Contents?: true
Size: 692 Bytes
Versions: 19
Compression:
Stored size: 692 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' module EhbrsRubyUtils class CircularListSpreader module BaseLevel extend ::Comparable def <=>(other) s = remaining_f <=> other.remaining_f return s unless s.zero? s = total_i <=> other.total_i return s unless s.zero? label <=> other.label end def remaining? remaining_i.positive? end def remaining_f remaining_i.to_f / total_i end def remaining_fs ((remaining_f * 1000).round / 10.0).to_s + '%' end def debugs [label, remaining_fs, total_i].join(' / ') end end end end
Version data entries
19 entries across 19 versions & 1 rubygems