Class: NilClass

Inherits:
Object
  • Object
show all
Defined in:
lib/dm_ruby_extensions/extend_nil.rb

Overview

If nil, then return a default string


Instance Method Summary collapse

Instance Method Details

#+(other) ⇒ Object

if nil + something, just return something




33
34
35
# File 'lib/dm_ruby_extensions/extend_nil.rb', line 33

def +(other)
  other
end

#as_booleanObject




12
13
14
# File 'lib/dm_ruby_extensions/extend_nil.rb', line 12

def as_boolean
  false
end

#sql_wildcardObject




22
23
24
# File 'lib/dm_ruby_extensions/extend_nil.rb', line 22

def sql_wildcard
  '%'
end

#to_ageObject




17
18
19
# File 'lib/dm_ruby_extensions/extend_nil.rb', line 17

def to_age
  0
end

#to_s_default(default_str = 'n/a') ⇒ Object




7
8
9
# File 'lib/dm_ruby_extensions/extend_nil.rb', line 7

def to_s_default(default_str = 'n/a')
  default_str
end

#utcObject




27
28
29
# File 'lib/dm_ruby_extensions/extend_nil.rb', line 27

def utc
  ''
end