Sha256: 3e9b740ae1e2b76ab574fd0aa66a647b935e9f4d7541504940b560e05abef62f
Contents?: true
Size: 889 Bytes
Versions: 8
Compression:
Stored size: 889 Bytes
Contents
module MetalArchives ## # Range which can start and/or end with +nil+ # class Range include Comparable ## # Begin- and endpoint of range # attr_accessor :begin, :end ## # Create a new range # # [+_begin+] # Start of range # # Default: +nil+ # # [+_end+] # End of range # # Default: +nil+ # def initialize(_begin = nil, _end = nil) @begin = _begin @end = _end end ## # Whether start of range is present # def begin? !!@begin end ## # Whether end of range is present # def end? !!@end end ## # Comparison operator # def <=>(other) comparison = self.begin <=> other.begin if comparison == 0 return self.end <=> other.end else return comparison end end end end
Version data entries
8 entries across 8 versions & 1 rubygems