Class: Picasa::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/picasa/connection.rb

Instance Method Summary collapse

Instance Method Details

#delete(params = {}) ⇒ Object

Options Hash (params):

  • :host (String)

    host of request

  • :path (String)

    request path

  • :query (String)

    request url query

  • :headers (String)

    request headers


35
36
37
# File 'lib/picasa/connection.rb', line 35

def delete(params = {})
  exec_request(params) { |uri, options| HTTP.delete(uri, options) }
end

#get(params = {}) ⇒ Object

Options Hash (params):

  • :host (String)

    host of request

  • :path (String)

    request path

  • :query (String)

    request url query

  • :headers (String)

    request headers


8
9
10
# File 'lib/picasa/connection.rb', line 8

def get(params = {})
  exec_request(params) { |uri, options| HTTP.get(uri, options) }
end

#patch(params = {}) ⇒ Object


24
25
26
27
28
# File 'lib/picasa/connection.rb', line 24

def patch(params = {})
  params[:headers] ||= {}
  params[:headers]["Content-Type"] ||= "application/xml"
  exec_request(params) { |uri, options| HTTP.patch(uri,options) }
end

#post(params = {}) ⇒ Object

Options Hash (params):

  • :host (String)

    host of request

  • :path (String)

    request path

  • :body (String)

    request body (for POST)

  • :query (String)

    request url query

  • :headers (String)

    request headers


18
19
20
21
22
# File 'lib/picasa/connection.rb', line 18

def post(params = {})
  params[:headers] ||= {}
  params[:headers]["Content-Type"] ||= "application/atom+xml"
  exec_request(params) { |uri, options| HTTP.post(uri, options) }
end