Class: Bundler::VersionRanges::ReqR::Endpoint
- Inherits:
-
Struct
- Object
- Struct
- Bundler::VersionRanges::ReqR::Endpoint
- Defined in:
- lib/bundler/version_ranges.rb
Instance Attribute Summary collapse
-
#inclusive ⇒ Object
Returns the value of attribute inclusive.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
Instance Attribute Details
#inclusive ⇒ Object
Returns the value of attribute inclusive
8 9 10 |
# File 'lib/bundler/version_ranges.rb', line 8 def inclusive @inclusive end |
#version ⇒ Object
Returns the value of attribute version
8 9 10 |
# File 'lib/bundler/version_ranges.rb', line 8 def version @version end |
Instance Method Details
#<=>(other) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bundler/version_ranges.rb', line 9 def <=>(other) if version.equal?(INFINITY) return 0 if other.version.equal?(INFINITY) return 1 elsif other.version.equal?(INFINITY) return -1 end comp = version <=> other.version return comp unless comp.zero? if inclusive && !other.inclusive 1 elsif !inclusive && other.inclusive -1 else 0 end end |