Sha256: 0161d8e1a3b2a2f1ecc1c19183be42fb112e40e08ce21d3e0d8acc4db2a62fa7

Contents?: true

Size: 557 Bytes

Versions: 3

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

class Revector
  module LessThan
    def self.check!(item, iteratee, right)
      left = Utility::TryFetchOrBlank[item, iteratee]
      return false unless left

      compare(left, right)
    end

    def self.compare(left, right)
      left < right
    end
  end

  module LessThanEqual
    def self.check!(item, iteratee, right)
      left = Utility::TryFetchOrBlank[item, iteratee]
      return false unless left

      compare(left, right)
    end

    def self.compare(left, right)
      left <= right
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
revector-0.1.2 lib/revector/predicate/less_than.rb
revector-0.1.1 lib/revector/predicate/less_than.rb
revector-0.1.0 lib/revector/predicate/less_than.rb