Sha256: 3b6f4466900a91d27e03b3fac32a8f0cc7ad84d1bd4b0b955997c0d9aae8da06

Contents?: true

Size: 450 Bytes

Versions: 3

Compression:

Stored size: 450 Bytes

Contents

class NilClass
  def &(other)
    false
  end

  def |(other)
    `other !== false && other !== nil`
  end

  def ^(other)
    `other !== false && other !== nil`
  end

  def ==(other)
    `other === nil`
  end

  def inspect
    'nil'
  end

  def nil?
    true
  end

  def singleton_class
    NilClass
  end

  def to_a
    []
  end

  def to_i
    0
  end

  alias to_f to_i

  def to_json
    'null'
  end

  def to_s
    ''
  end
end

NIL = nil

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opal-0.3.22 core/nil_class.rb
opal-0.3.21 core/nil_class.rb
opal-0.3.20 core/nil_class.rb