Sha256: 107cfbb069984531957e483a8c4fd2e606df22455999ea3eb038a0f958a40fb1
Contents?: true
Size: 821 Bytes
Versions: 5
Compression:
Stored size: 821 Bytes
Contents
module Solve class Solver # @author Andrew Garson <andrew.garson@gmail.com> # @author Jamie Winsor <jamie@vialstudios.com> class ConstraintTable attr_reader :rows def initialize @rows = Array.new end # @param [Solve::Dependency] dependency # @param [String, Symbol] source # # @return [Array<ConstraintRow>] def add(dependency, source) @rows << ConstraintRow.new(dependency, source) end def constraints_on_artifact(name) @rows.select do |row| row.name == name end.map { |row| row.constraint } end def remove_constraints_from_source!(source) from_source, others = @rows.partition { |row| row.source == source } @rows = others from_source end end end end
Version data entries
5 entries across 5 versions & 1 rubygems