Sha256: 239d1109495bbf3e49a5a750908d4861c9b9d152ba60ab54997da66745e06fa7

Contents?: true

Size: 899 Bytes

Versions: 6

Compression:

Stored size: 899 Bytes

Contents

# If nil, then return a default string
#------------------------------------------------------------------------------
class NilClass #:nodoc:

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

  #------------------------------------------------------------------------------
  def as_boolean
    false
  end
  
  #------------------------------------------------------------------------------
  def to_age
    0
  end

  #------------------------------------------------------------------------------
  def sql_wildcard
    "%"	  
  end
  
  #------------------------------------------------------------------------------
  def utc
    ""
  end
  
  # if nil + something, just return something
  #------------------------------------------------------------------------------
  def +(y)
    y
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dm_ruby_extensions-1.0.9 lib/dm_ruby_extensions/extend_nil.rb
dm_ruby_extensions-1.0.8 lib/dm_ruby_extensions/extend_nil.rb
dm_ruby_extensions-1.0.7 lib/dm_ruby_extensions/extend_nil.rb
dm_ruby_extensions-1.0.6 lib/dm_ruby_extensions/extend_nil.rb
dm_ruby_extensions-1.0.5 lib/dm_ruby_extensions/extend_nil.rb
dm_ruby_extensions-1.0.0 lib/dm_ruby_extensions/extend_nil.rb