123456789_123456789_123456789_123456789_123456789_

Class: Bundler::VersionRanges::ReqR

Relationships & Source Files
Namespace Children
Classes:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Struct
Inherits: Struct
  • Object
Defined in: lib/bundler/version_ranges.rb,
lib/bundler/version_ranges.rb

Constant Summary

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#empty?Boolean (readonly)

[ GitHub ]

  
# File 'lib/bundler/version_ranges.rb', line 27

def empty?
  left.version == right.version && !(left.inclusive && right.inclusive)
end

#left (rw)

[ GitHub ]

  
# File 'lib/bundler/version_ranges.rb', line 6

ReqR = Struct.new(:left, :right)

#right (rw)

[ GitHub ]

  
# File 'lib/bundler/version_ranges.rb', line 6

ReqR = Struct.new(:left, :right)

#single?Boolean (readonly)

[ GitHub ]

  
# File 'lib/bundler/version_ranges.rb', line 31

def single?
  left.version == right.version
end

Instance Method Details

#cover?(v) ⇒ Boolean

[ GitHub ]

  
# File 'lib/bundler/version_ranges.rb', line 15

def cover?(v)
  return false if left.inclusive && left.version > v
  return false if !left.inclusive && left.version >= v

  if right.version != INFINITY
    return false if right.inclusive && right.version < v
    return false if !right.inclusive && right.version <= v
  end

  true
end

#to_s

[ GitHub ]

  
# File 'lib/bundler/version_ranges.rb', line 9

def to_s
  "#{left.inclusive ? "[" : "("}#{left.version}, #{right.version}#{right.inclusive ? "]" : ")"}"
end