class SemanticPuppet::VersionRange::MinMaxRange
@api private
Attributes
Public Class Methods
Source
# File lib/semantic_puppet/version_range.rb, line 539 def self.create(*ranges) ranges.reduce { |memo, range| memo.intersection(range) } end
Source
# 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
Public Instance Methods
Source
# File lib/semantic_puppet/version_range.rb, line 564 def eql?(other) super && @min.eql?(other.min) && @max.eql?(other.max) end
Calls superclass method
SemanticPuppet::VersionRange::AbstractRange#eql?
Source
# File lib/semantic_puppet/version_range.rb, line 556 def exclude_begin? @min.exclude_begin? end
Source
# File lib/semantic_puppet/version_range.rb, line 560 def exclude_end? @max.exclude_end? end
Source
# File lib/semantic_puppet/version_range.rb, line 568 def hash @min.hash ^ @max.hash end
Source
# File lib/semantic_puppet/version_range.rb, line 572 def include?(version) @min.include?(version) && @max.include?(version) end
Source
# File lib/semantic_puppet/version_range.rb, line 576 def lower_bound? @min.lower_bound? end
Source
# File lib/semantic_puppet/version_range.rb, line 584 def test_prerelease?(version) @min.test_prerelease?(version) || @max.test_prerelease?(version) end
Source
# File lib/semantic_puppet/version_range.rb, line 588 def to_s "#{@min} #{@max}" end
Also aliased as: inspect
Source
# File lib/semantic_puppet/version_range.rb, line 580 def upper_bound? @max.upper_bound? end