Permalink
Browse files

Adding documentation

  • Loading branch information...
blaix committed Sep 25, 2009
1 parent ee184e7 commit 7d091a9eec9d8f9fbbc0ccd24d02829a374aa6d6
Showing with 17 additions and 2 deletions.
  1. +13 −2 README.rdoc
  2. +4 −0 lib/cheddargetter.rb
View
@@ -6,11 +6,22 @@ Yes, CheddarGetter provides a ruby gem for this already, but the more I tried to
== Installation
-TODO
+ gem install ads-cheddargetter -s http://gems.github.com
== Usage
-TODO
+Pass in your CheddarGetter username (email), password, and the product code for the product you'll be working with:
+
+ @cheddar_getter = CheddarGetter.new('me@mysite.com', 'password', 'MY_PRODUCT')
+
+=== Get all plans:
+
+ @cheddar_getter.plans
+
+returns an array of plans:
+
+ [{"name" => "Little", "code" => "LITTLE", "recurringChargeAmount" => "1.00", etc...},
+ {"name" => "Big", "code" => "BIG", "recurringChargeAmount" => "100.00", etc..}]
== Copyright
View
@@ -11,6 +11,10 @@ def initialize(username, password, product_code)
self.class.basic_auth(username, password)
end
+ # Returns an array of plans:
+ #
+ # [{"name" => "Little", "code" => "LITTLE", "recurringChargeAmount" => "1.00", etc...},
+ # {"name" => "Big", "code" => "BIG", "recurringChargeAmount" => "100.00", etc..}]
def plans
response = get("https://cheddargetter.com/xml/plans/get/productCode/#{@product_code}")
normalize(response, 'plans', 'plan')

0 comments on commit 7d091a9

Please sign in to comment.