Class: SemanticPuppet::VersionRange::ComparatorRange Private

Inherits:
AbstractRange show all
Defined in:
lib/puppet/vendor/semantic_puppet/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.



619
620
621
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 619

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.



617
618
619
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 617

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)


623
624
625
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 623

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.



627
628
629
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 627

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

#stable?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)


636
637
638
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 636

def stable?
  @version.stable?
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)


632
633
634
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 632

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