app/lib/hstore_filter.rb
# At a minimum, expect the input to respond to these methods.
At a minimum, expect the input to respond to these methods.
At a minimum expect the input to respond to these methods .
def filter(input)
        not_hash = HASHY_METHODS
          .map{|x| input.respond_to?(x) }
          .uniq
          .include?(false)
        return [input, :not_hash] if not_hash
        output = input
          .map{|x| Pair.new(*x) }
          .inject({}) do |hash, pair|
            hash[pair.head.to_sym] = pair.tail.to_s
            hash
          end
        [output, nil]
    end
def filter ( input ) not_hash = HASHY_METHODS . map { | x | input . respond_to? ( x ) } . uniq . include? ( false ) return [ input , :not_hash ] if not_hash output = input . map { | x | Pair . new ( * x ) } . inject ( { } ) do | hash , pair | hash [ pair . head . to_sym ] = pair . tail . to_s hash end [ output , nil ] end
At a minimum, expect the input to respond to these methods.
At a minimum expect the input to respond to these methods .
input