Class: UndefClass

Inherits:
Object
  • Object
show all
Defined in:
yard-stubs/carray_undef.rb

Overview

Singleton class of the UNDEF sentinel value. Not instantiable (UndefClass.new is undef'd after the single instance is created in Init_carray_undef).

The class is private API in practice: read and write the sentinel through the top-level UNDEF constant rather than touching the class directly.

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Boolean

Returns true only when other is the same UNDEF singleton (identity comparison). No coercion or value equality.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


47
# File 'yard-stubs/carray_undef.rb', line 47

def ==(other); end

#inspectString

Returns the literal string "UNDEF".

Returns:

  • (String)


16
# File 'yard-stubs/carray_undef.rb', line 16

def inspect; end

#to_fObject

Raises TypeError. Numeric coercion of UNDEF is rejected so that accidental arithmetic on a masked sentinel surfaces as an error rather than silently producing 0.0 / NaN.

Raises:

  • (TypeError)


30
# File 'yard-stubs/carray_undef.rb', line 30

def to_f; end

#to_iObject

Raises TypeError. Same rationale as #to_f.

Raises:

  • (TypeError)


35
# File 'yard-stubs/carray_undef.rb', line 35

def to_i; end

#to_intObject

Alias of #to_i. Raises TypeError.

Raises:

  • (TypeError)


40
# File 'yard-stubs/carray_undef.rb', line 40

def to_int; end

#to_sString

Returns the literal string "UNDEF". Display works (so puts UNDEF shows "UNDEF"); numeric coercion via #to_f / #to_i raises.

Returns:

  • (String)


23
# File 'yard-stubs/carray_undef.rb', line 23

def to_s; end