Class: MultipartPost

Inherits:
Object
  • Object
show all
Defined in:
lib/google-picasa/multipartpost.rb

Constant Summary collapse

BOUNDARY =
'flickrrocks-aaaaaabbbb0000'
HEADER =
{"Content-type" => "multipart/form-data, boundary=" + BOUNDARY + " "}

Instance Method Summary collapse

Instance Method Details

#prepare_query(params) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/google-picasa/multipartpost.rb', line 42

def prepare_query ( params )
  fp = []
  params.each do |k,v|
	if v.respond_to?(:read)
	  fp.push(FileParam.new(k,v.path,v.read))
	else
	  fp.push(Param.new(k,v))
	end
  end
  query = fp.collect {|p| "--" + BOUNDARY + "\r\n" + p.to_multipart }.join("") + "--" + BOUNDARY + "--"
  return query, HEADER
end