lib/signore/sig_finder.rb in signore-0.6.0 vs lib/signore/sig_finder.rb in signore-0.7.0

- old
+ new

@@ -1,21 +1,13 @@ -# frozen_string_literal: true - require_relative 'signature' require_relative 'tags' module Signore - class SigFinder - def initialize(random: Random.new) - @random = random - end + module SigFinder + module_function - def find(sigs, tags: Tags.new) + def find(sigs, random: Random.new, tags: Tags.new) shuffled = sigs.shuffle(random: random) shuffled.find(-> { Signature.new }) { |sig| tags.match?(sig.tags) } end - - private - - attr_reader :random end end