Class: NilClass

Inherits:
Object show all
Defined in:
lib/jeweler/utils/core_ext/NilClass.rb

Overview

These, as well as the methods above are for displaying these numbers in the UI. I prefer these cleaner methods to the decorator pattern (in these few use-cases), because it is really really clean.

Instance Method Summary collapse

Instance Method Details

#hoursObject

Returns ‘0 hr.’



10
11
12
# File 'lib/jeweler/utils/core_ext/NilClass.rb', line 10

def hours
  return '0 hr.'
end

#moneyObject

Returns ‘$0’



15
16
17
# File 'lib/jeweler/utils/core_ext/NilClass.rb', line 15

def money
  return '$0'
end

#prettifyObject

Returns 0



5
6
7
# File 'lib/jeweler/utils/core_ext/NilClass.rb', line 5

def prettify
  return 0
end

#to_bObject

Returns False



25
26
27
# File 'lib/jeweler/utils/core_ext/NilClass.rb', line 25

def to_b
  return false
end

#true?Boolean

Returns False

Returns:

  • (Boolean)


20
21
22
# File 'lib/jeweler/utils/core_ext/NilClass.rb', line 20

def true?
  return false
end