Sha256: d03cdbd8b0085a29ef1419d5a57198e4198681ffbd40c194e549b64d13a37ceb

Contents?: true

Size: 1.75 KB

Versions: 22

Compression:

Stored size: 1.75 KB

Contents

# The class of the singleton object `nil`.
# 
class NilClass
  public

  # And---Returns `false`. *obj* is always evaluated as it is the argument to a
  # method call---there is no short-circuit evaluation in this case.
  # 
  def &: (untyped obj) -> bool

  # Case Equality -- For class Object, effectively the same as calling `#==`, but
  # typically overridden by descendants to provide meaningful semantics in `case`
  # statements.
  # 
  def ===: (nil) -> true
         | (untyped obj) -> bool

  # Dummy pattern matching -- always returns nil.
  # 
  def =~: (untyped obj) -> nil

  # Exclusive Or---If *obj* is `nil` or `false`, returns `false`; otherwise,
  # returns `true`.
  # 
  def ^: (nil) -> false
       | (false) -> false
       | (untyped obj) -> bool

  # Always returns the string "nil".
  # 
  def inspect: () -> "nil"

  # Only the object *nil* responds `true` to `nil?`.
  # 
  def nil?: () -> bool

  # Returns zero as a rational.  The optional argument `eps` is always ignored.
  # 
  def rationalize: (?untyped eps) -> Rational

  # Always returns an empty array.
  # 
  #     nil.to_a   #=> []
  # 
  def to_a: () -> [ ]

  # Returns zero as a complex.
  # 
  def to_c: () -> Complex

  # Always returns zero.
  # 
  #     nil.to_f   #=> 0.0
  # 
  def to_f: () -> Float

  # Always returns an empty hash.
  # 
  #     nil.to_h   #=> {}
  # 
  def to_h: () -> ::Hash[untyped, untyped]

  # Always returns zero.
  # 
  #     nil.to_i   #=> 0
  # 
  def to_i: () -> 0

  # Returns zero as a rational.
  # 
  def to_r: () -> Rational

  # Always returns the empty string.
  # 
  def to_s: () -> ""

  # Or---Returns `false` if *obj* is `nil` or `false`; `true` otherwise.
  # 
  def |: (nil) -> false
       | (false) -> false
       | (untyped obj) -> bool
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
rbs-0.13.1 stdlib/builtin/nil_class.rbs
rbs-0.13.0 stdlib/builtin/nil_class.rbs
rbs-0.12.2 stdlib/builtin/nil_class.rbs
rbs-0.12.1 stdlib/builtin/nil_class.rbs
rbs-0.12.0 stdlib/builtin/nil_class.rbs
rbs-0.11.0 stdlib/builtin/nil_class.rbs
rbs-0.10.0 stdlib/builtin/nil_class.rbs
rbs-0.9.1 stdlib/builtin/nil_class.rbs
rbs-0.9.0 stdlib/builtin/nil_class.rbs
rbs-0.8.0 stdlib/builtin/nil_class.rbs
rbs-0.7.0 stdlib/builtin/nil_class.rbs
rbs-0.6.0 stdlib/builtin/nil_class.rbs
rbs-0.5.0 stdlib/builtin/nil_class.rbs
rbs-0.4.0 stdlib/builtin/nil_class.rbs
rbs-0.3.1 stdlib/builtin/nil_class.rbs
rbs-0.3.0 stdlib/builtin/nil_class.rbs
rbs-0.2.0 stdlib/builtin/nil_class.rbs
steep-0.16.0 vendor/ruby-signature/stdlib/builtin/nil_class.rbs
steep-0.15.0 vendor/ruby-signature/stdlib/builtin/nil_class.rbs
steep-0.14.0 vendor/ruby-signature/stdlib/builtin/nil_class.rbs