Sha256: 97d7446372d73ccacd4b0e7362dad030f9a01bbb5cfb6535cb7126667935ec42

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

class Hash
  # def to_yaml(opts = {})
  #   YAML::quick_emit(object_id, opts) do |out|
  #     out.map(taguri, to_yaml_style) do |map|
  #       sort.each do |k, v| # "sort" added
  #         map.add(k, v)
  #       end
  #     end
  #   end
  # end

  def kv_join(s)
    self.map do |k, v|
      if v.is_a?(Hash)
        # When upload a file, make tempfile and other params out of hash.
        v.key?('tempfile') ? "#{k}=#{v['filename']}" : v.kv_join(s)
      else
        "#{k}#{s}#{v}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
core_extend-0.2.1 lib/core_extend/hash.rb