Class: NilClass

Inherits:
Object show all
Defined in:
lib/moon/packages/std/core_ext/nil_class.rb

Instance Method Summary collapse

Instance Method Details

#blank?true

nil is always blank.

Returns:

  • (true)

14
15
16
# File 'lib/moon/packages/std/core_ext/nil_class.rb', line 14

def blank?
  true
end

#presencenil

nil should always return a presence of nil.

Returns:

  • (nil)

7
8
9
# File 'lib/moon/packages/std/core_ext/nil_class.rb', line 7

def presence
  nil
end

#try(method_name = nil, *args, &block) ⇒ Void

When invoking try, nil does nothing.

Parameters:

Returns:

  • (Void)

23
24
25
# File 'lib/moon/packages/std/core_ext/nil_class.rb', line 23

def try(method_name = nil, *args, &block)
  #
end