Class: SemanticPuppet::VersionRange::MinMaxRange Private
- Inherits:
-
AbstractRange
- Object
- AbstractRange
- SemanticPuppet::VersionRange::MinMaxRange
- 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.
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
- #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.
543 544 545 546 |
# File 'lib/semantic_puppet/version_range.rb', line 543 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.
537 538 539 |
# File 'lib/semantic_puppet/version_range.rb', line 537 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.
537 538 539 |
# File 'lib/semantic_puppet/version_range.rb', line 537 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.
539 540 541 |
# File 'lib/semantic_puppet/version_range.rb', line 539 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.
548 549 550 |
# File 'lib/semantic_puppet/version_range.rb', line 548 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.
552 553 554 |
# File 'lib/semantic_puppet/version_range.rb', line 552 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.
564 565 566 |
# File 'lib/semantic_puppet/version_range.rb', line 564 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.
556 557 558 |
# File 'lib/semantic_puppet/version_range.rb', line 556 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.
560 561 562 |
# File 'lib/semantic_puppet/version_range.rb', line 560 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.
568 569 570 |
# File 'lib/semantic_puppet/version_range.rb', line 568 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.
572 573 574 |
# File 'lib/semantic_puppet/version_range.rb', line 572 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.
576 577 578 |
# File 'lib/semantic_puppet/version_range.rb', line 576 def lower_bound? @min.lower_bound? 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.
584 585 586 |
# File 'lib/semantic_puppet/version_range.rb', line 584 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.
588 589 590 |
# File 'lib/semantic_puppet/version_range.rb', line 588 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.
580 581 582 |
# File 'lib/semantic_puppet/version_range.rb', line 580 def upper_bound? @max.upper_bound? end |