Sha256: ef46e3ab04a4820330d8f6cb0639dc01f60107929d6afb6b0c4ea258299f192f

Contents?: true

Size: 474 Bytes

Versions: 20

Compression:

Stored size: 474 Bytes

Contents

module HashExtensions
  def deep_merge(hash)
    target = dup
    hash.keys.each do |key|
      if hash[key].is_a? Hash and self[key].is_a? Hash
        target[key] = target[key].deep_merge(hash[key])
        next
      end
      target[key] = hash[key]
    end
    target
  end
end
module StringExtensions
  def simple_sql_sanitizer
    gsub(/\\/, '\&\&').gsub(/'/, "''")
  end
end

module ObjectExtensions
  # Nil if empty.
  def nie
    self.blank? ? nil : self
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
BBenezech-papermill-0.1.0 lib/core_extensions.rb
BBenezech-papermill-0.1.1 lib/core_extensions.rb
BBenezech-papermill-0.1.2 lib/core_extensions.rb
BBenezech-papermill-0.1.3 lib/core_extensions.rb
BBenezech-papermill-0.1.4 lib/core_extensions.rb
BBenezech-papermill-0.2.0 lib/core_extensions.rb
BBenezech-papermill-0.2.1 lib/core_extensions.rb
BBenezech-papermill-0.2.2 lib/core_extensions.rb
BBenezech-papermill-0.3.0 lib/core_extensions.rb
BBenezech-papermill-0.4.0 lib/core_extensions.rb
BBenezech-papermill-0.4.1 lib/core_extensions.rb
BBenezech-papermill-0.5.0 lib/core_extensions.rb
BBenezech-papermill-0.5.2 lib/core_extensions.rb
BBenezech-papermill-0.5.4 lib/core_extensions.rb
papermill-0.7.0 lib/core_extensions.rb
papermill-0.6.1 lib/core_extensions.rb
papermill-0.6.0 lib/core_extensions.rb
papermill-0.5.8 lib/core_extensions.rb
papermill-0.5.7 lib/core_extensions.rb
BBenezech-papermill-0.5.5 lib/core_extensions.rb