Sha256: 2321f639fc6b827dfc5cf9c1e0a782370b08313acb0a6727776090e3c871e9e5

Contents?: true

Size: 695 Bytes

Versions: 4

Compression:

Stored size: 695 Bytes

Contents

# several ways to create placeholders in Sequel statements
module Kernel
private
  def PlaceHolder( name, sql_field = nil, bt = caller )
    Philtre::PlaceHolder.new name, sql_field, bt = caller
  end

  alias_method :Lieu, :PlaceHolder
end

class Symbol
  def lieu( sql_field = nil )
    Lieu self, sql_field, caller
  end

  def place_holder( sql_field = nil )
    PlaceHolder self, sql_field, caller
  end
end

unless Hash.instance_methods.include? :slice
  class Hash
    # return a hash containing only the specified keys
    def slice( *other_keys )
      other_keys.inject(Hash.new) do |hash, key|
        hash[key] = self[key] if has_key?( key )
        hash
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
philtre-0.1.2 lib/philtre/core_extensions.rb
philtre-0.1.1 lib/philtre/core_extensions.rb
philtre-0.1.0 lib/philtre/core_extensions.rb
philtre-0.0.1 lib/philtre/core_extensions.rb