Sha256: 7cdf2bbe5312e2df29ed0f812584cba66330c684906ea2c366aee3c1bc152716

Contents?: true

Size: 322 Bytes

Versions: 1

Compression:

Stored size: 322 Bytes

Contents

module RubyQuiz2
  class SelectionRules

    def valid?(santa, giftee)
      return false if santa == giftee
      return false if santa.related_to?(giftee)
      true
    end

    def valid_set?(selections)
      return false unless selections.collect(&:giftee).uniq.size == selections.size
      true
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_quiz_2-1.0.0 lib/ruby_quiz_2/selection_rules.rb