class Solve::Dependency

Attributes

artifact[R]

A reference to the artifact this dependency belongs to

@return [Solve::Artifact]

constraint[R]

The constraint requirement of this dependency

@return [Semverse::Constraint]

name[R]

The name of the artifact this dependency represents

@return [String]

Public Class Methods

new(artifact, name, constraint = Semverse::DEFAULT_CONSTRAINT) click to toggle source

@param [Solve::Artifact] artifact @param [#to_s] name @param [Semverse::Constraint, to_s] constraint

# File lib/solve/dependency.rb, line 21
def initialize(artifact, name, constraint = Semverse::DEFAULT_CONSTRAINT)
  @artifact   = artifact
  @name       = name
  @constraint = Semverse::Constraint.coerce(constraint)
end

Public Instance Methods

==(other) click to toggle source

@param [Object] other

@return [Boolean]

# File lib/solve/dependency.rb, line 35
def ==(other)
  other.is_a?(self.class) &&
    name == other.name &&
    artifact == other.artifact &&
    constraint == other.constraint
end
Also aliased as: eql?
eql?(other)
Alias for: ==
inspect()
Alias for: to_s
to_s() click to toggle source
# File lib/solve/dependency.rb, line 27
def to_s
  "#{name} (#{constraint})"
end
Also aliased as: inspect