shushu 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/models/res_own.rb +1 -1
  2. data/readme.md +27 -11
  3. metadata +5 -5
@@ -17,7 +17,7 @@ module Shushu
17
17
  eid = args.delete(:entity_id)
18
18
  hid = args[:hid]
19
19
  time = args[:time]
20
- Shushu.handle_req {RestClient.delete([res_own_url(aid, eid), CGI.encode("?hid=#{hid}&time=#{time}")].join)}
20
+ Shushu.handle_req {RestClient.delete([res_own_url(aid, eid), build_q_params(:hid => hid, :time => time)].join)}
21
21
  end
22
22
 
23
23
  def query(args)
data/readme.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Shushu Client
2
2
 
3
- ## Purpose
4
-
5
- This gem wraps the APIs defined [here](https://github.com/heroku/shushu/tree/master/doc).
3
+ This gem wraps the APIs defined [here](https://github.com/heroku/shushud/tree/master/doc).
6
4
  The shushu client also provides a set of objects that help with the presentation
7
5
  of an invoice.
8
6
 
@@ -15,10 +13,14 @@ $ gem install shushu
15
13
  ```bash
16
14
  # Optional. When set, shushu will ignore bad responses from Shushu's API.
17
15
  # Default: false
16
+
18
17
  $SHUSHU_CLIENT_UNSAFE=true
18
+ ```
19
19
 
20
+ ```bash
20
21
  # Required
21
22
  # Default: nil
23
+
22
24
  $SHUSHU_URL=https://shushu-stg.heroku.com
23
25
  ```
24
26
 
@@ -30,6 +32,20 @@ Shushu.url = "https://core:secret@shushu-stg.heroku.com"
30
32
 
31
33
  ## Usage
32
34
 
35
+ You can call methods in models directly via the model's module or you can create
36
+ a client object to dispatch methods to the model. This is useful if want to use
37
+ provider credentials other than the ones defined in the `$SHUSHU_URL`
38
+
39
+ ```ruby
40
+ shushu = Shushu::Client.new("https://other_provider_id:other_provider_token@shushu.heroku.com")
41
+ shushu[:b_event].open({})
42
+ ```
43
+ Is equivalent to:
44
+
45
+ ```ruby
46
+ Shushu::BEvent.open({})
47
+ ```
48
+
33
49
  ### PaymentMethods
34
50
 
35
51
  This API deals primarily with credit cards. PaymentMethods can be created
@@ -55,8 +71,7 @@ will need an account to generate a usage report.
55
71
  Use this API when you want to setup associations between Vault accounts and
56
72
  Vault payment_methods.
57
73
 
58
- For complete details on the semantics of this API, read the [AccountOwnerships
59
- API docs.](https://github.com/heroku/shushu/blob/master/doc/account_ownership_api.md)
74
+ Reference: [AccountOwnerships API](https://github.com/heroku/shushud/blob/master/doc/account_ownership_api.md)
60
75
 
61
76
  ```ruby
62
77
  # To associate an account with a payment_method
@@ -80,7 +95,7 @@ API docs.](https://github.com/heroku/shushu/blob/master/doc/account_ownership_ap
80
95
  #=> {"payment_method_id"=>"456", "account_id"=>"1", "entity_id"=>"event124"}
81
96
  ```
82
97
 
83
- ### RateCodes
98
+ ### RateCode
84
99
 
85
100
  Before you can send BillableEvents to Shushu, you will need to provision a
86
101
  RateCode.
@@ -89,7 +104,7 @@ RateCode.
89
104
  * product_group - string.
90
105
  * product_name - string. optional. you can also pass the product name in an event.
91
106
 
92
- [Shushu API Docs](https://github.com/heroku/shushu/blob/master/doc/rate_code_api.md)
107
+ Reference: [RateCode API](https://github.com/heroku/shushud/blob/master/doc/rate_code_api.md)
93
108
 
94
109
  ```ruby
95
110
  Shushu::RCode.create(
@@ -100,13 +115,12 @@ RateCode.
100
115
  #=> {:slug => "AO01", :rate => 5, :product_group => "addon", :product_name => "postgres"}
101
116
  ```
102
117
 
103
- ### ResourceOwnerships
118
+ ### ResourceOwnership
104
119
 
105
120
  Use this API when dealing with resources and Vault accounts. For instance:
106
121
  Heroku apps and Teams.
107
122
 
108
- For complete details on the semantics of this API, read the [ResourceOwnerships
109
- API docs.](https://github.com/heroku/shushu/blob/master/doc/resource_ownership_api.md)
123
+ Reference: [ResourceOwnership API](https://github.com/heroku/shushud/blob/master/doc/resource_ownership_api.md)
110
124
 
111
125
  ```ruby
112
126
  # When a new app is created, activate a new resource_ownership record.
@@ -140,7 +154,7 @@ API docs.](https://github.com/heroku/shushu/blob/master/doc/resource_ownership_a
140
154
  #=> {"hid"=>"123", "account_id"=>"1", "entity_id"=>"event123"}
141
155
  ```
142
156
 
143
- ### BillableEvents
157
+ ### BillableEvent
144
158
 
145
159
  Use this API when you want to start billing for a resource. You can start
146
160
  emitting events prior to setting up relationships between accounts and
@@ -150,6 +164,8 @@ until account_ownerships and resource_ownerships have been established.)
150
164
  For complete details on the semantics of this API, read the [BillableEvents
151
165
  API docs.](https://github.com/heroku/shushu/blob/master/doc/events_api.md)
152
166
 
167
+ Reference: [BillableEvent API](https://github.com/heroku/shushud/blob/master/doc/billable_events_api.md)
168
+
153
169
  ```ruby
154
170
  # Open an event when you would like to start billing.
155
171
  Shushu::BEvent.open(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shushu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-12-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &15437440 !ruby/object:Gem::Requirement
16
+ requirement: &8914300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15437440
24
+ version_requirements: *8914300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: yajl-ruby
27
- requirement: &15436920 !ruby/object:Gem::Requirement
27
+ requirement: &8913620 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 1.1.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *15436920
35
+ version_requirements: *8913620
36
36
  description: A ruby wrapper around Shushu's HTTP API.
37
37
  email: ryan@heroku.com
38
38
  executables: []