Sha256: 816e1bd5b11bf07db15bdf0318a808b504f46eeff7cc7b757ae2ada4497d2bc1

Contents?: true

Size: 383 Bytes

Versions: 3

Compression:

Stored size: 383 Bytes

Contents

require 'httparty'

module ShareProgress
  class Utils    
    class << self

      def filter_keys(params, acceptable)
        return params if params.nil?
        params.select!{ |key, _| acceptable.include? key }
      end

      def symbolize_keys(params)
        fresh = Hash.new
        params.each_pair{ |k, v| fresh[k.to_sym] = v }
        fresh
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
share_progress-0.1.2 lib/share_progress/utils.rb
share_progress-0.1.1 lib/share_progress/utils.rb
share_progress-0.1.0 lib/share_progress/utils.rb