Class: RBelly::JS::NaN

Inherits:
Numeric
  • Object
show all
Defined in:
lib/rbelly/js/nan.rb

Overview

Class to represent Not A Number In Ruby NaN != NaN, but in JS, NaN == NaN

Instance Method Summary collapse

Instance Method Details

#+(o) ⇒ Object



14
# File 'lib/rbelly/js/nan.rb', line 14

def +(o); self; end

#-(o) ⇒ Object



15
# File 'lib/rbelly/js/nan.rb', line 15

def -(o); self; end

#==(other) ⇒ Object



6
7
8
# File 'lib/rbelly/js/nan.rb', line 6

def ==(other)
  other.respond_to?(:nan?) && other.nan?
end

#nan?Boolean

Returns:



10
11
12
# File 'lib/rbelly/js/nan.rb', line 10

def nan?
  true
end