neuron-client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/neuron-client/ad.rb
CHANGED
@@ -19,11 +19,6 @@ module Neuron
|
|
19
19
|
:start_datetime, :end_datetime, :time_zone,
|
20
20
|
# timestamps
|
21
21
|
:created_at, :updated_at
|
22
|
-
|
23
|
-
def valid?
|
24
|
-
validate
|
25
|
-
@errors.empty?
|
26
|
-
end
|
27
22
|
|
28
23
|
def self.stringify_day_partitions(days)
|
29
24
|
result = ""
|
@@ -32,23 +27,9 @@ module Neuron
|
|
32
27
|
end
|
33
28
|
result
|
34
29
|
end
|
35
|
-
|
36
|
-
def validate
|
37
|
-
@errors = []
|
38
|
-
@errors << [:approved, "is not 'Yes' or 'No'"] if ["Yes", "No"].include?(@approved)
|
39
|
-
@errors << [:response_type, "is not 'Redirect' or 'Video'"] if ["Redirect", "Video"].include?(@response_type)
|
40
|
-
@errors << [:start_datetime, "is required"] if @start_datetime.blank?
|
41
|
-
@errors << [:end_datetime, "is required"] if @end_datetime.blank?
|
42
|
-
@errors << [:time_zone, "is required"] if @time_zone.blank?
|
43
|
-
|
44
|
-
if @response_type == "Video"
|
45
|
-
@errors << [:video_api_url, "is required"] if @video_api_url.blank?
|
46
|
-
@errors << [:video_setup_xml, "is required"] if @video_setup_xml.blank?
|
47
|
-
elsif @response_type == "Redirect"
|
48
|
-
@errors << [:redirect_url, "is required"] if @redirect_url.blank?
|
49
|
-
end
|
50
30
|
|
51
|
-
|
31
|
+
def recent(statistic, parameters)
|
32
|
+
self.class.connection.get("ads/#{id}/recent/#{statistic}", parameters)
|
52
33
|
end
|
53
34
|
|
54
35
|
def unlink(ad_id)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
- !ruby/struct:VCR::HTTPInteraction
|
3
3
|
request: !ruby/struct:VCR::Request
|
4
4
|
method: :post
|
5
|
-
uri: http://127.0.0.1:3000/s3_files.json?api_key=
|
5
|
+
uri: http://127.0.0.1:3000/s3_files.json?api_key=secret
|
6
6
|
body: !!null
|
7
7
|
headers:
|
8
8
|
accept:
|
@@ -19,7 +19,7 @@
|
|
19
19
|
message: Created
|
20
20
|
headers:
|
21
21
|
location:
|
22
|
-
- http://127.0.0.1:3000/s3_files/
|
22
|
+
- http://127.0.0.1:3000/s3_files/1
|
23
23
|
content-type:
|
24
24
|
- application/json; charset=utf-8
|
25
25
|
cache-control:
|
@@ -27,22 +27,22 @@
|
|
27
27
|
x-ua-compatible:
|
28
28
|
- IE=Edge
|
29
29
|
x-runtime:
|
30
|
-
- '
|
30
|
+
- '2.156203'
|
31
31
|
server:
|
32
32
|
- WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
|
33
33
|
date:
|
34
|
-
-
|
34
|
+
- Tue, 26 Jul 2011 21:15:03 GMT
|
35
35
|
content-length:
|
36
|
-
- '
|
36
|
+
- '156'
|
37
37
|
set-cookie:
|
38
|
-
- _neuron-admin_session=
|
38
|
+
- _neuron-admin_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlNTkyMGNkZGRkZGEzMmI3ODFiMDhlZjI3ZjZjN2Y5ZTY%3D--abc9759030ac57f081014793dd0a18200acd40ce;
|
39
39
|
path=/; HttpOnly
|
40
|
-
body: ! '{"s3_file":{"bucket":"test","created_at":"2011-07-
|
40
|
+
body: ! '{"s3_file":{"bucket":"test","created_at":"2011-07-26T21:15:03Z","filename":"filename","id":1,"purpose":"RAW_EVENT_LOG","updated_at":"2011-07-26T21:15:03Z"}}'
|
41
41
|
http_version: '1.1'
|
42
42
|
- !ruby/struct:VCR::HTTPInteraction
|
43
43
|
request: !ruby/struct:VCR::Request
|
44
44
|
method: :get
|
45
|
-
uri: http://127.0.0.1:3000/s3_files.json?api_key=
|
45
|
+
uri: http://127.0.0.1:3000/s3_files.json?api_key=secret
|
46
46
|
body: !!null
|
47
47
|
headers:
|
48
48
|
accept:
|
@@ -59,25 +59,25 @@
|
|
59
59
|
content-type:
|
60
60
|
- application/json; charset=utf-8
|
61
61
|
etag:
|
62
|
-
- ! '"
|
62
|
+
- ! '"f28f9f731f02abb52de52eeb140f3904"'
|
63
63
|
cache-control:
|
64
64
|
- max-age=0, private, must-revalidate
|
65
65
|
x-ua-compatible:
|
66
66
|
- IE=Edge
|
67
67
|
x-runtime:
|
68
|
-
- '0.
|
68
|
+
- '0.058083'
|
69
69
|
server:
|
70
70
|
- WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
|
71
71
|
date:
|
72
|
-
-
|
72
|
+
- Tue, 26 Jul 2011 21:15:03 GMT
|
73
73
|
content-length:
|
74
|
-
- '
|
75
|
-
body: ! '[{"s3_file":{"bucket":"
|
74
|
+
- '158'
|
75
|
+
body: ! '[{"s3_file":{"bucket":"test","created_at":"2011-07-26T21:15:03Z","filename":"filename","id":1,"purpose":"RAW_EVENT_LOG","updated_at":"2011-07-26T21:15:03Z"}}]'
|
76
76
|
http_version: '1.1'
|
77
77
|
- !ruby/struct:VCR::HTTPInteraction
|
78
78
|
request: !ruby/struct:VCR::Request
|
79
79
|
method: :get
|
80
|
-
uri: http://127.0.0.1:3000/s3_files/
|
80
|
+
uri: http://127.0.0.1:3000/s3_files/1.json?api_key=secret
|
81
81
|
body: !!null
|
82
82
|
headers:
|
83
83
|
accept:
|
@@ -94,25 +94,25 @@
|
|
94
94
|
content-type:
|
95
95
|
- application/json; charset=utf-8
|
96
96
|
etag:
|
97
|
-
- ! '"
|
97
|
+
- ! '"67aa857a0fae3ef759591bfd7c6ce984"'
|
98
98
|
cache-control:
|
99
99
|
- max-age=0, private, must-revalidate
|
100
100
|
x-ua-compatible:
|
101
101
|
- IE=Edge
|
102
102
|
x-runtime:
|
103
|
-
- '0.
|
103
|
+
- '0.058488'
|
104
104
|
server:
|
105
105
|
- WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
|
106
106
|
date:
|
107
|
-
-
|
107
|
+
- Tue, 26 Jul 2011 21:15:03 GMT
|
108
108
|
content-length:
|
109
|
-
- '
|
110
|
-
body: ! '{"s3_file":{"bucket":"test","created_at":"2011-07-
|
109
|
+
- '156'
|
110
|
+
body: ! '{"s3_file":{"bucket":"test","created_at":"2011-07-26T21:15:03Z","filename":"filename","id":1,"purpose":"RAW_EVENT_LOG","updated_at":"2011-07-26T21:15:03Z"}}'
|
111
111
|
http_version: '1.1'
|
112
112
|
- !ruby/struct:VCR::HTTPInteraction
|
113
113
|
request: !ruby/struct:VCR::Request
|
114
114
|
method: :get
|
115
|
-
uri: http://127.0.0.1:3000/s3_files/
|
115
|
+
uri: http://127.0.0.1:3000/s3_files/1.json?api_key=secret
|
116
116
|
body: !!null
|
117
117
|
headers:
|
118
118
|
accept:
|
@@ -129,25 +129,25 @@
|
|
129
129
|
content-type:
|
130
130
|
- application/json; charset=utf-8
|
131
131
|
etag:
|
132
|
-
- ! '"
|
132
|
+
- ! '"67aa857a0fae3ef759591bfd7c6ce984"'
|
133
133
|
cache-control:
|
134
134
|
- max-age=0, private, must-revalidate
|
135
135
|
x-ua-compatible:
|
136
136
|
- IE=Edge
|
137
137
|
x-runtime:
|
138
|
-
- '0.
|
138
|
+
- '0.103646'
|
139
139
|
server:
|
140
140
|
- WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
|
141
141
|
date:
|
142
|
-
-
|
142
|
+
- Tue, 26 Jul 2011 21:15:03 GMT
|
143
143
|
content-length:
|
144
|
-
- '
|
145
|
-
body: ! '{"s3_file":{"bucket":"test","created_at":"2011-07-
|
144
|
+
- '156'
|
145
|
+
body: ! '{"s3_file":{"bucket":"test","created_at":"2011-07-26T21:15:03Z","filename":"filename","id":1,"purpose":"RAW_EVENT_LOG","updated_at":"2011-07-26T21:15:03Z"}}'
|
146
146
|
http_version: '1.1'
|
147
147
|
- !ruby/struct:VCR::HTTPInteraction
|
148
148
|
request: !ruby/struct:VCR::Request
|
149
149
|
method: :put
|
150
|
-
uri: http://127.0.0.1:3000/s3_files/
|
150
|
+
uri: http://127.0.0.1:3000/s3_files/1.json?api_key=secret
|
151
151
|
body: !!null
|
152
152
|
headers:
|
153
153
|
accept:
|
@@ -172,22 +172,22 @@
|
|
172
172
|
x-ua-compatible:
|
173
173
|
- IE=Edge
|
174
174
|
x-runtime:
|
175
|
-
- '0.
|
175
|
+
- '0.062569'
|
176
176
|
server:
|
177
177
|
- WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
|
178
178
|
date:
|
179
|
-
-
|
179
|
+
- Tue, 26 Jul 2011 21:15:03 GMT
|
180
180
|
content-length:
|
181
181
|
- '2'
|
182
182
|
set-cookie:
|
183
|
-
- _neuron-admin_session=
|
183
|
+
- _neuron-admin_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlODcyMjcxYjA1YzMzYjhmY2Q4YTQyY2NmMTg3ZWZlNjM%3D--3ea83e017a27c14576690a4d98b58f12c9c3b480;
|
184
184
|
path=/; HttpOnly
|
185
185
|
body: ! '{}'
|
186
186
|
http_version: '1.1'
|
187
187
|
- !ruby/struct:VCR::HTTPInteraction
|
188
188
|
request: !ruby/struct:VCR::Request
|
189
189
|
method: :get
|
190
|
-
uri: http://127.0.0.1:3000/s3_files/
|
190
|
+
uri: http://127.0.0.1:3000/s3_files/1.json?api_key=secret
|
191
191
|
body: !!null
|
192
192
|
headers:
|
193
193
|
accept:
|
@@ -204,18 +204,18 @@
|
|
204
204
|
content-type:
|
205
205
|
- application/json; charset=utf-8
|
206
206
|
etag:
|
207
|
-
- ! '"
|
207
|
+
- ! '"717dca0db92d340da526fc4e869d36a6"'
|
208
208
|
cache-control:
|
209
209
|
- max-age=0, private, must-revalidate
|
210
210
|
x-ua-compatible:
|
211
211
|
- IE=Edge
|
212
212
|
x-runtime:
|
213
|
-
- '0.
|
213
|
+
- '0.102077'
|
214
214
|
server:
|
215
215
|
- WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
|
216
216
|
date:
|
217
|
-
-
|
217
|
+
- Tue, 26 Jul 2011 21:15:03 GMT
|
218
218
|
content-length:
|
219
|
-
- '
|
220
|
-
body: ! '{"s3_file":{"bucket":"test","created_at":"2011-07-
|
219
|
+
- '158'
|
220
|
+
body: ! '{"s3_file":{"bucket":"test","created_at":"2011-07-26T21:15:03Z","filename":"filename_2","id":1,"purpose":"RAW_EVENT_LOG","updated_at":"2011-07-26T21:15:03Z"}}'
|
221
221
|
http_version: '1.1'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neuron-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,12 +10,12 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-08-01 00:00:00.000000000 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rest-client
|
18
|
-
requirement: &
|
18
|
+
requirement: &2157689420 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: 1.6.3
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *2157689420
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: yajl-ruby
|
29
|
-
requirement: &
|
29
|
+
requirement: &2157688920 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: 0.8.2
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *2157688920
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: rspec
|
40
|
-
requirement: &
|
40
|
+
requirement: &2157688460 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: 2.6.0
|
46
46
|
type: :development
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *2157688460
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: simplecov
|
51
|
-
requirement: &
|
51
|
+
requirement: &2157688000 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: 0.4.2
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *2157688000
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: rb-fsevent
|
62
|
-
requirement: &
|
62
|
+
requirement: &2157687500 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
@@ -67,10 +67,10 @@ dependencies:
|
|
67
67
|
version: 0.4.1
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *2157687500
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: guard
|
73
|
-
requirement: &
|
73
|
+
requirement: &2157687040 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ! '>='
|
@@ -78,10 +78,10 @@ dependencies:
|
|
78
78
|
version: 0.5.1
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *2157687040
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: guard-bundler
|
84
|
-
requirement: &
|
84
|
+
requirement: &2157686580 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
87
87
|
- - ! '>='
|
@@ -89,10 +89,10 @@ dependencies:
|
|
89
89
|
version: 0.1.3
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
|
-
version_requirements: *
|
92
|
+
version_requirements: *2157686580
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: guard-rspec
|
95
|
-
requirement: &
|
95
|
+
requirement: &2157686120 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
98
98
|
- - ! '>='
|
@@ -100,10 +100,10 @@ dependencies:
|
|
100
100
|
version: 0.4.0
|
101
101
|
type: :development
|
102
102
|
prerelease: false
|
103
|
-
version_requirements: *
|
103
|
+
version_requirements: *2157686120
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: fakeweb
|
106
|
-
requirement: &
|
106
|
+
requirement: &2157685660 !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
109
109
|
- - ! '>='
|
@@ -111,10 +111,10 @@ dependencies:
|
|
111
111
|
version: 1.3.0
|
112
112
|
type: :development
|
113
113
|
prerelease: false
|
114
|
-
version_requirements: *
|
114
|
+
version_requirements: *2157685660
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: vcr
|
117
|
-
requirement: &
|
117
|
+
requirement: &2157685200 !ruby/object:Gem::Requirement
|
118
118
|
none: false
|
119
119
|
requirements:
|
120
120
|
- - ! '>='
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
version: 1.10.2
|
123
123
|
type: :development
|
124
124
|
prerelease: false
|
125
|
-
version_requirements: *
|
125
|
+
version_requirements: *2157685200
|
126
126
|
description: Neuron Admin Client Gem
|
127
127
|
email:
|
128
128
|
- devteam@rmmonline.com
|