Class: SemanticPuppet::VersionRange::MinMaxRange 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.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractRange

#==, #intersection, #merge

Constructor Details

#initialize(min, max) ⇒ MinMaxRange

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 MinMaxRange.



560
561
562
563
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 560

def initialize(min, max)
  @min = min.is_a?(MinMaxRange) ? min.min : min
  @max = max.is_a?(MinMaxRange) ? max.max : max
end

Instance Attribute Details

#maxObject (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.



554
555
556
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 554

def max
  @max
end

#minObject (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.



554
555
556
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 554

def min
  @min
end

Class Method Details

.create(*ranges) ⇒ Object

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.



556
557
558
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 556

def self.create(*ranges)
  ranges.reduce { |memo, range| memo.intersection(range) }
end

Instance Method Details

#beginObject

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.



565
566
567
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 565

def begin
  @min.begin
end

#endObject

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.



569
570
571
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 569

def end
  @max.end
end

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


581
582
583
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 581

def eql?(other)
  super && @min.eql?(other.min) && @max.eql?(other.max)
end

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


573
574
575
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 573

def exclude_begin?
  @min.exclude_begin?
end

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


577
578
579
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 577

def exclude_end?
  @max.exclude_end?
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.



585
586
587
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 585

def hash
  @min.hash ^ @max.hash
end

#include?(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.

Returns:

  • (Boolean)


589
590
591
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 589

def include?(version)
  @min.include?(version) && @max.include?(version)
end

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


593
594
595
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 593

def lower_bound?
  @min.lower_bound?
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)


605
606
607
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 605

def stable?
  @min.stable? && @max.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.

Returns:

  • (Boolean)


601
602
603
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 601

def test_prerelease?(version)
  @min.test_prerelease?(version) || @max.test_prerelease?(version)
end

#to_sObject Also known as: inspect

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.



609
610
611
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 609

def to_s
  "#{@min} #{@max}"
end

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


597
598
599
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 597

def upper_bound?
  @max.upper_bound?
end