soapy_cake 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/api_versions.yml +1 -5
- data/lib/soapy_cake/admin.rb +8 -0
- data/lib/soapy_cake/client.rb +1 -1
- data/lib/soapy_cake/request.rb +6 -2
- data/lib/soapy_cake/version.rb +1 -1
- data/spec/lib/soapy_cake/admin_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccfb53cd1acb5dd4c887db9e6b8d1443a84f14e0
|
4
|
+
data.tar.gz: bd9583c20ffb66b565a01fdd1a6dee4e5c098ab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2090e6b76e51f22a9433f96f6219fb78b70da409e37267cb3a723109e06bc136381bfd7b89450d6e88f4c71bbf1563751a58e23c99f69bb47c5393a173fa3ab
|
7
|
+
data.tar.gz: 8001350960a4a9b6e173f37212f6d7ab24195bd8633ef319aae6f5e2c97297bfad67bb25b64ec80eba901c6a35dfe0c3315ffb8bcba8fd3d2a2f252f91ff8050
|
data/api_versions.yml
CHANGED
@@ -100,12 +100,8 @@ admin:
|
|
100
100
|
update_conversion_revenue: 1
|
101
101
|
update_lead_price: 2
|
102
102
|
update_sale_revenue: 1
|
103
|
-
|
104
|
-
reports:
|
105
|
-
bills: 1
|
106
|
-
affiliates:
|
103
|
+
affiliate:
|
107
104
|
reports:
|
108
105
|
bills: 3
|
109
106
|
offers:
|
110
107
|
offer_feed: 4
|
111
|
-
get_campaign: 2
|
data/lib/soapy_cake/admin.rb
CHANGED
@@ -68,6 +68,10 @@ module SoapyCake
|
|
68
68
|
run Request.new(:admin, :reports, :traffic_export, opts)
|
69
69
|
end
|
70
70
|
|
71
|
+
def caps(opts = {})
|
72
|
+
run Request.new(:admin, :reports, :caps, opts)
|
73
|
+
end
|
74
|
+
|
71
75
|
def currencies(*)
|
72
76
|
run Request.new(:admin, :get, :currencies, {})
|
73
77
|
end
|
@@ -75,5 +79,9 @@ module SoapyCake
|
|
75
79
|
def update_creative(opts = {})
|
76
80
|
run Request.new(:admin, :addedit, :creative, opts)
|
77
81
|
end
|
82
|
+
|
83
|
+
def update_offer(opts = {})
|
84
|
+
run Request.new(:admin, :addedit, :offer, opts)
|
85
|
+
end
|
78
86
|
end
|
79
87
|
end
|
data/lib/soapy_cake/client.rb
CHANGED
@@ -4,7 +4,7 @@ module SoapyCake
|
|
4
4
|
|
5
5
|
def initialize(opts = {})
|
6
6
|
@domain = opts.fetch(:domain, ENV['CAKE_DOMAIN']) || fail(Error, 'Cake domain missing')
|
7
|
-
@api_key = opts.fetch(:
|
7
|
+
@api_key = opts.fetch(:api_key, ENV['CAKE_API_KEY']) || fail(Error, 'Cake API key missing')
|
8
8
|
@time_offset = opts.fetch(:time_offset, ENV['CAKE_TIME_OFFSET']) \
|
9
9
|
|| fail(Error, 'Cake time offset missing')
|
10
10
|
@opts = opts
|
data/lib/soapy_cake/request.rb
CHANGED
@@ -11,7 +11,7 @@ module SoapyCake
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def path
|
14
|
-
"
|
14
|
+
"#{api_path}/#{service}.asmx"
|
15
15
|
end
|
16
16
|
|
17
17
|
def xml
|
@@ -29,6 +29,10 @@ module SoapyCake
|
|
29
29
|
|
30
30
|
private
|
31
31
|
|
32
|
+
def api_path
|
33
|
+
"#{(role != 'admin') ? "/#{role.pluralize}" : ''}/api/#{version}"
|
34
|
+
end
|
35
|
+
|
32
36
|
def xml_params(xml)
|
33
37
|
xml.api_key api_key
|
34
38
|
opts.each do |k, v|
|
@@ -39,7 +43,7 @@ module SoapyCake
|
|
39
43
|
def xml_namespaces
|
40
44
|
{
|
41
45
|
'xmlns:env' => 'http://www.w3.org/2003/05/soap-envelope',
|
42
|
-
'xmlns:cake' => "http://cakemarketing.com
|
46
|
+
'xmlns:cake' => "http://cakemarketing.com#{api_path}/"
|
43
47
|
}
|
44
48
|
end
|
45
49
|
|
data/lib/soapy_cake/version.rb
CHANGED
@@ -115,6 +115,11 @@ RSpec.describe SoapyCake::Admin do
|
|
115
115
|
let(:cake_method) { :traffic_export }
|
116
116
|
it_behaves_like 'a cake admin method'
|
117
117
|
end
|
118
|
+
|
119
|
+
describe '#caps' do
|
120
|
+
let(:method) { :caps }
|
121
|
+
it_behaves_like 'a cake admin method'
|
122
|
+
end
|
118
123
|
end
|
119
124
|
|
120
125
|
describe 'get service' do
|
@@ -135,5 +140,11 @@ RSpec.describe SoapyCake::Admin do
|
|
135
140
|
let(:cake_method) { :creative }
|
136
141
|
it_behaves_like 'a cake admin method'
|
137
142
|
end
|
143
|
+
|
144
|
+
describe '#update_creative' do
|
145
|
+
let(:method) { :update_offer }
|
146
|
+
let(:cake_method) { :offer }
|
147
|
+
it_behaves_like 'a cake admin method'
|
148
|
+
end
|
138
149
|
end
|
139
150
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soapy_cake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ad2games GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|