From 9eb66847e46944aaef7c09a0e9a9b3de5cada3d3 Mon Sep 17 00:00:00 2001 From: Adam Wiggins Date: Sat, 21 Jun 2008 16:02:10 -0700 Subject: [PATCH] improve nesting examples --- lib/resource.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/resource.rb b/lib/resource.rb index 114900b..f36df0b 100644 --- a/lib/resource.rb +++ b/lib/resource.rb @@ -70,13 +70,13 @@ module RestClient # This is especially useful if you wish to define your site in one place and # call it in multiple locations: # - # def product(id) - # RestClient::Resource.new('http://example.com/products/#{id}', 'adam', 'mypasswd') + # def orders + # RestClient::Resource.new('http://example.com/orders', 'admin', 'mypasswd') # end # - # product(123).get - # product(123).put params.to_xml - # product(123).delete + # orders.get # GET http://example.com/orders + # orders['1'].get # GET http://example.com/orders/1 + # orders['1/items'].delete # DELETE http://example.com/orders/1/items # # Nest resources as far as you want: #