Sha256: c76243fa54fe73755543c8d2f6fe5db4d5938727740bf7cb9387418fd871c8fa

Contents?: true

Size: 367 Bytes

Versions: 41

Compression:

Stored size: 367 Bytes

Contents

# Extend Nilclass to avoid nil.xxx errors when empty data returned from database
class NilClass
  def to_date
    nil
  end

  def titleize
    nil
  end

  def surnameize
    nil
  end

  def postcodeize(*)
    nil
  end

  def upcase
    nil
  end

  def clean(*)
    nil
  end

  def squash
    nil
  end

  def gsub(*)
    ''
  end

  def strip
    nil
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
ndr_support-5.10.4 lib/ndr_support/nil.rb
ndr_support-5.10.3 lib/ndr_support/nil.rb
ndr_support-5.10.2 lib/ndr_support/nil.rb
ndr_support-5.10.1 lib/ndr_support/nil.rb
ndr_support-5.10.0 lib/ndr_support/nil.rb
ndr_support-5.9.7 lib/ndr_support/nil.rb
ndr_support-5.9.6 lib/ndr_support/nil.rb
ndr_support-5.9.5 lib/ndr_support/nil.rb
ndr_support-5.9.4 lib/ndr_support/nil.rb
ndr_support-5.9.3 lib/ndr_support/nil.rb
ndr_support-5.9.2 lib/ndr_support/nil.rb
ndr_support-5.9.1 lib/ndr_support/nil.rb
ndr_support-5.9.0 lib/ndr_support/nil.rb
ndr_support-5.8.4 lib/ndr_support/nil.rb
ndr_support-5.8.3 lib/ndr_support/nil.rb
ndr_support-5.8.2 lib/ndr_support/nil.rb
ndr_support-5.8.1 lib/ndr_support/nil.rb
ndr_support-5.8.0 lib/ndr_support/nil.rb
ndr_support-5.7.1 lib/ndr_support/nil.rb
ndr_support-5.7.0 lib/ndr_support/nil.rb