Module: Nestful

Extended by:
Nestful
Included in:
Nestful
Defined in:
lib/nestful.rb,
lib/nestful/oauth.rb,
lib/nestful/formats.rb,
lib/nestful/request.rb,
lib/nestful/resource.rb,
lib/nestful/connection.rb,
lib/nestful/exceptions.rb,
lib/nestful/request/callbacks.rb,
lib/nestful/formats/xml_format.rb,
lib/nestful/formats/form_format.rb,
lib/nestful/formats/json_format.rb,
lib/nestful/formats/text_format.rb,
lib/nestful/formats/blank_format.rb,
lib/nestful/formats/multipart_format.rb

Defined Under Namespace

Modules: Formats Classes: BadRequest, ClientError, Connection, ConnectionError, ForbiddenAccess, MethodNotAllowed, Redirection, Request, Resource, ResourceConflict, ResourceGone, ResourceInvalid, ResourceNotFound, SSLError, ServerError, TimeoutError, UnauthorizedAccess

Instance Method Summary collapse

Instance Method Details

#delete(url, options = {}) ⇒ Object



32
33
34
# File 'lib/nestful.rb', line 32

def delete(url, options = {})
  Request.new(url, ({:method => :delete}).merge(options)).execute
end

#get(url, options = {}) ⇒ Object



20
21
22
# File 'lib/nestful.rb', line 20

def get(url, options = {})
  Request.new(url, ({:method => :get}).merge(options)).execute
end

#json_get(url, params = nil) ⇒ Object



36
37
38
# File 'lib/nestful.rb', line 36

def json_get(url, params = nil)
  get(url, :format => :json, :params => params)
end

#json_post(url, params = nil) ⇒ Object



40
41
42
# File 'lib/nestful.rb', line 40

def json_post(url, params = nil)
  post(url, :format => :json, :params => params)
end

#post(url, options = {}) ⇒ Object



24
25
26
# File 'lib/nestful.rb', line 24

def post(url, options = {})
  Request.new(url, ({:method => :post, :format => :form}).merge(options)).execute
end

#put(url, options = {}) ⇒ Object



28
29
30
# File 'lib/nestful.rb', line 28

def put(url, options = {})
  Request.new(url, ({:method => :put}).merge(options)).execute
end