Module: Comparable

Included in:
Date, Date::Infinity, Numeric, OpenSSL::BN, REXML::Comment, REXML::Text, SpecVersion, String, Time
Defined in:
lib/framework/builtinME.rb

Instance Method Summary collapse

Instance Method Details

#<(value) ⇒ Object



469
470
471
472
# File 'lib/framework/builtinME.rb', line 469

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

#<=(value) ⇒ Object



459
460
461
462
# File 'lib/framework/builtinME.rb', line 459

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

#==(value) ⇒ Object



454
455
456
457
# File 'lib/framework/builtinME.rb', line 454

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

#>(value) ⇒ Object



464
465
466
467
# File 'lib/framework/builtinME.rb', line 464

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

#>=(value) ⇒ Object



449
450
451
452
# File 'lib/framework/builtinME.rb', line 449

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

#between?(a, b) ⇒ Boolean

Returns:

  • (Boolean)


474
475
476
# File 'lib/framework/builtinME.rb', line 474

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