lib/key_vortex/limitation.rb in key-vortex-0.1.3 vs lib/key_vortex/limitation.rb in key-vortex-0.1.4

- old
+ new

@@ -28,13 +28,19 @@ def prohibits?(limitation) !allows?(limitation) end + def applicable_constraints(constraint) + @constraints.select do |con| + con.applies_to?(constraint) + end + end + def accomodates?(constraint) - @constraints.all? do |con| + !applicable_constraints(constraint).select do |con| con.within?(constraint) - end + end.empty? end def to_s "Limitation: #{@type}\n\t#{@constraints.join('\n\t')}" end