Skip to content

ComboStrikeHQ/soapy_cake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1aca5e1 · Feb 25, 2022
Sep 7, 2021
Sep 7, 2021
Jul 14, 2020
Apr 3, 2014
Feb 10, 2015
Nov 16, 2016
Sep 7, 2021
May 14, 2020
Apr 3, 2014
Aug 16, 2018
Jun 26, 2017
Jul 14, 2020
Feb 25, 2022

Repository files navigation

SoapyCake

Maintainability Test Coverage Gem Version Circle CI

Simple client library for cake.

Installation

Add this line to your application's Gemfile:

gem 'soapy_cake'

And then execute:

$ bundle

Or install it yourself as:

$ gem install soapy_cake

Usage Examples

First we assume that you set the CAKE_DOMAIN, CAKE_API_KEY and CAKE_TIME_ZONE environment variables. To enable the ADD, EDIT and ADDEDIT API endpoints, CAKE_WRITE_ENABLED=yes should also be set.

Export all advertisers:

SoapyCake::Admin.new.advertisers(opts)

Get report for specific date range:

SoapyCake::Admin.new.affiliate_summary(
  start_date: Date.beginning_of_month,
  end_date: Date.current
)

If you are interested in how we map methods to api endpoints take a look at api.yml.

Time/Date Handling

  • Define CAKE_TIME_ZONE
  • Specify dates with any timezone in requests (will be converted to the correct CAKE timezone)
  • Date objects in requests will be treated as UTC (just like .to_datetime would do)
  • Responses contain UTC dates which can be converted however you like

Contributing

  1. Fork it (https://github.com/ad2games/soapy_cake/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request