Class: SemanticPuppet::VersionRange::MinMaxRange Private
- Inherits:
-
AbstractRange
- Object
- AbstractRange
- SemanticPuppet::VersionRange::MinMaxRange
- 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
- #max ⇒ Object readonly private
- #min ⇒ Object readonly private
Class Method Summary collapse
- .create(*ranges) ⇒ Object private
Instance Method Summary collapse
- #begin ⇒ Object private
- #end ⇒ Object private
- #eql?(other) ⇒ Boolean private
- #exclude_begin? ⇒ Boolean private
- #exclude_end? ⇒ Boolean private
- #hash ⇒ Object private
- #include?(version) ⇒ Boolean private
-
#initialize(min, max) ⇒ MinMaxRange
constructor
private
A new instance of MinMaxRange.
- #lower_bound? ⇒ Boolean private
- #stable? ⇒ Boolean private
- #test_prerelease?(version) ⇒ Boolean private
- #to_s ⇒ Object (also: #inspect) private
- #upper_bound? ⇒ Boolean private
Methods inherited from AbstractRange
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
#max ⇒ Object (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 |
#min ⇒ Object (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
#begin ⇒ 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.
565 566 567 |
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 565 def begin @min.begin end |
#end ⇒ 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.
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.
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.
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.
577 578 579 |
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 577 def exclude_end? @max.exclude_end? end |
#hash ⇒ 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.
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.
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.
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.
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.
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_s ⇒ Object 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.
597 598 599 |
# File 'lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb', line 597 def upper_bound? @max.upper_bound? end |