Class: SemanticPuppet::VersionRange::ComparatorRange Private

Inherits:
AbstractRange
  • Object
show all
Defined in:
lib/semantic_puppet/version_range.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

EqRange, GtEqRange, GtRange, LtEqRange, LtRange

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractRange

#==, #begin, #end, #exclude_begin?, #exclude_end?, #include?, #intersection, #lower_bound?, #merge, #upper_bound?

Constructor Details

#initialize(version) ⇒ ComparatorRange

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ComparatorRange.



598
599
600
# File 'lib/semantic_puppet/version_range.rb', line 598

def initialize(version)
  @version = version
end

Instance Attribute Details

#versionObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



596
597
598
# File 'lib/semantic_puppet/version_range.rb', line 596

def version
  @version
end

Instance Method Details

#eql?(other) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


602
603
604
# File 'lib/semantic_puppet/version_range.rb', line 602

def eql?(other)
  super && @version.eql?(other.version)
end

#hashObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



606
607
608
# File 'lib/semantic_puppet/version_range.rb', line 606

def hash
  @class.hash ^ @version.hash
end

#test_prerelease?(version) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Checks if this matcher accepts a prerelease with the same major, minor, patch triple as the given version

Returns:

  • (Boolean)


611
612
613
# File 'lib/semantic_puppet/version_range.rb', line 611

def test_prerelease?(version)
  !@version.stable? && @version.major == version.major && @version.minor == version.minor && @version.patch == version.patch
end