Class: Integer

Inherits:
Numeric show all
Defined in:
opal/opal/corelib/numeric.rb

Class Method Summary collapse

Methods inherited from Numeric

#%, #&, #*, #**, #+, #+@, #-, #-@, #/, #<, #<<, #<=, #<=>, #==, #>, #>=, #>>, #[], #^, #__id__, #abs, #ceil, #chr, #coerce, #conj, #divmod, #downto, #equal?, #even?, #finite?, #floor, #gcd, #gcdlcm, #hash, #infinite?, #instance_of?, #integer?, #is_a?, #lcm, #nan?, #negative?, #next, #nonzero?, #odd?, #ord, #positive?, #pred, #round, #send_coerced, #size, #step, #times, #to_f, #to_i, #to_s, #upto, #zero?, #|, #~

Methods included from Comparable

#<, #<=, #==, #>, #>=, #between?, normalize

Class Method Details

.===(other) ⇒ Object



525
526
527
528
529
530
531
532
533
# File 'opal/opal/corelib/numeric.rb', line 525

def self.===(other)
  %x{
    if (!other.$$is_number) {
      return false;
    }

    return (other % 1) === 0;
  }
end