Sha256: 83f7239c092572e8c83ed98cb6a64ef1690779cbf84ae86294d00c470dae4895

Contents?: true

Size: 516 Bytes

Versions: 14

Compression:

Stored size: 516 Bytes

Contents

class NilClass
  def !
    true
  end

  def &(other)
    false
  end

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

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

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

  def dup
    raise TypeError
  end

  def inspect
    'nil'
  end

  def nil?
    true
  end

  def singleton_class
    NilClass
  end

  def to_a
    []
  end

  def to_h
    `Opal.hash()`
  end

  def to_i
    0
  end

  alias to_f to_i

  def to_s
    ''
  end
end

NIL = nil

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
opal-0.8.1 opal/corelib/nil_class.rb
opal-0.8.1.rc1 opal/corelib/nil_class.rb
opal-wedge-0.9.0.dev opal/corelib/nil_class.rb
opal-0.8.0 opal/corelib/nil_class.rb
opal-0.8.0.rc3 opal/corelib/nil_class.rb
opal-0.8.0.rc2 opal/corelib/nil_class.rb
opal-0.8.0.rc1 opal/corelib/nil_class.rb
opal-0.8.0.beta1 opal/corelib/nil_class.rb
opal-0.7.2 opal/corelib/nil_class.rb
opal-0.7.1 opal/corelib/nil_class.rb
opal-0.7.0 opal/corelib/nil_class.rb
opal-0.7.0.rc1 opal/corelib/nil_class.rb
opal-0.7.0.beta3 opal/corelib/nil_class.rb
opal-0.7.0.beta2 opal/corelib/nil_class.rb