Module: Comparable

Included in:
Date, Date::Infinity, Numeric, String, Time
Defined in:
lib/builtinME.rb

Instance Method Summary collapse

Instance Method Details

#<(value) ⇒ Object



365
366
367
368
# File 'lib/builtinME.rb', line 365

def <(value)
    compare = (self <=> value)
    return compare == -1
end

#<=(value) ⇒ Object



355
356
357
358
# File 'lib/builtinME.rb', line 355

def <=(value)
    compare = (self <=> value)
    return compare != 1 and compare != nil
end

#==(value) ⇒ Object



350
351
352
353
# File 'lib/builtinME.rb', line 350

def ==(value)
    compare = (self <=> value)
    return compare == 0
end

#>(value) ⇒ Object



360
361
362
363
# File 'lib/builtinME.rb', line 360

def >(value)
    compare = (self <=> value)
    return compare == 1
end

#>=(value) ⇒ Object



345
346
347
348
# File 'lib/builtinME.rb', line 345

def >=(value)
    compare = (self <=> value)
    return compare != -1 and compare != nil
end

#between?(a, b) ⇒ Boolean

Returns:

  • (Boolean)


370
371
372
# File 'lib/builtinME.rb', line 370

def between?(a, b)
    self >= a && self <= b
end