No commit activity in last 3 years
No release in over 3 years
A more flexible solution for accessing the Cheddargetter API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0.3.2
>= 0.10.0
 Project Readme

This project borrows highly from cheddargetter_client_ruby. I completely reuse their response object.

I felt however their implementation of calls to the Cheddargetter api were too static, so I implemented a wrapper using method missing. This way if methods are added to the api, they can be easily accessed. Here are some mappings. There should be a noticable pattern.

  • #/customers/get
    -- cg_client_object.customers_get({:customer_code => 'ABCD'}) (code optional)

  • #/customers/new
    -- cg_client_object.customers_new({ :customer_code => CustomerCode, :firstName => 'W Pain', :lastName => 'Alemeda', :email => 'w_pain@example.com',
    :subscription => {:planCode => PlanCodes.last} })

  • #/customers/edit -- cg_client.customers_edit({:customer_code => 'ABCD'}, valid_customer_attributes_hash)

  • #/customers/edit-customer
    -- cg_client.customers_edit_customer({:customer_code => 'ABCD'}, valid_customer_attributes_hash)

  • #/customers/edit-subscription
    -- cg_client.customers_edit_subscription({:customer_code => 'ABCD'}, {:subscription => ValidSubscription})

  • #/customers/delete
    -- cg_client.customers_delete({:customer_code => 'ABCD'})

  • #/customers/cancel
    -- cg_client.customers_cancel({:customer_code => 'ABCD'})

  • #/customers/add-item-quantity
    -- cg_client.customers_add_item_quantity({:customer_code => CustomerCode, :itemCode => item_code}

  • #/customers/remove-item-quantity
    -- cg_client.customers_remove_item_quantity({:customer_code => CustomerCode, :itemCode => item_code}, {:quantity => 5})

  • #/customers/set-item-quantity
    cg_client.customers_set_item_quantity({:customer_code => CustomerCode, :itemCode => item_code}, {:quantity => 13}

See the specs more examples. These are copied from them.