neuron-client 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ module Neuron
10
10
  :redirect_url,
11
11
  # video
12
12
  :video_api_url, :video_setup_xml, :video_flv_url,
13
- :video_clickthru_url, :video_companion_ad_html, :social_links,
13
+ :video_clickthru_url, :video_companion_ad_html, :social_links, :social_links_attributes,
14
14
  # caps
15
15
  :frequency_cap_limit, :frequency_cap_window, :overall_cap,
16
16
  :daily_cap, :day_partitions, :ideal_impressions_per_hour,
@@ -11,10 +11,11 @@ module Neuron
11
11
  self.class.attributes || []
12
12
  end
13
13
 
14
- def to_hash
14
+ def to_hash(*except)
15
15
  hash = {}
16
- attributes.each do |attribute|
17
- hash[attribute] = send(attribute)
16
+ attributes.reject{|a| except.collect(&:to_sym).include?(a.to_sym)}.each do |attribute|
17
+ value = send(attribute)
18
+ hash[attribute] = value unless value.nil?
18
19
  end
19
20
  hash
20
21
  end
@@ -26,10 +27,10 @@ module Neuron
26
27
  def save
27
28
  @errors = catch :errors do
28
29
  if new_record?
29
- response = self.class.connection.post("#{self.class.resources_name}", {self.class.resource_name => self.to_hash})
30
+ response = self.class.connection.post("#{self.class.resources_name}", {self.class.resource_name => self.to_hash(:errors, :updated_at, :created_at)})
30
31
  self.id = response[self.class.resource_name]['id']
31
32
  else
32
- response = self.class.connection.put("#{self.class.resources_name}/#{id}", {self.class.resource_name => self.to_hash})
33
+ response = self.class.connection.put("#{self.class.resources_name}/#{id}", {self.class.resource_name => self.to_hash(:errors, :updated_at, :created_at)})
33
34
  end
34
35
  []
35
36
  end
@@ -49,6 +50,10 @@ module Neuron
49
50
  @errors.empty?
50
51
  end
51
52
 
53
+ def valid?
54
+ @errors.empty?
55
+ end
56
+
52
57
  def destroy
53
58
  self.class.connection.delete("#{self.class.resources_name}/#{id}")
54
59
  end
@@ -1,5 +1,5 @@
1
1
  module Neuron
2
2
  module Client
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
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.7
4
+ version: 0.0.8
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-08-09 00:00:00.000000000 -04:00
13
+ date: 2011-08-10 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: &20119040 !ruby/object:Gem::Requirement
18
+ requirement: &70201594494800 !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: *20119040
26
+ version_requirements: *70201594494800
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: yajl-ruby
29
- requirement: &20118540 !ruby/object:Gem::Requirement
29
+ requirement: &70201594494300 !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: *20118540
37
+ version_requirements: *70201594494300
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: rspec
40
- requirement: &20118080 !ruby/object:Gem::Requirement
40
+ requirement: &70201594493840 !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: *20118080
48
+ version_requirements: *70201594493840
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: simplecov
51
- requirement: &20151080 !ruby/object:Gem::Requirement
51
+ requirement: &70201594493380 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,21 @@ dependencies:
56
56
  version: 0.4.2
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *20151080
59
+ version_requirements: *70201594493380
60
+ - !ruby/object:Gem::Dependency
61
+ name: rb-fsevent
62
+ requirement: &70201594492880 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: 0.4.1
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: *70201594492880
60
71
  - !ruby/object:Gem::Dependency
61
72
  name: guard
62
- requirement: &20150600 !ruby/object:Gem::Requirement
73
+ requirement: &70201594492420 !ruby/object:Gem::Requirement
63
74
  none: false
64
75
  requirements:
65
76
  - - ! '>='
@@ -67,10 +78,10 @@ dependencies:
67
78
  version: 0.5.1
68
79
  type: :development
69
80
  prerelease: false
70
- version_requirements: *20150600
81
+ version_requirements: *70201594492420
71
82
  - !ruby/object:Gem::Dependency
72
83
  name: guard-bundler
73
- requirement: &20150140 !ruby/object:Gem::Requirement
84
+ requirement: &70201594491960 !ruby/object:Gem::Requirement
74
85
  none: false
75
86
  requirements:
76
87
  - - ! '>='
@@ -78,10 +89,10 @@ dependencies:
78
89
  version: 0.1.3
79
90
  type: :development
80
91
  prerelease: false
81
- version_requirements: *20150140
92
+ version_requirements: *70201594491960
82
93
  - !ruby/object:Gem::Dependency
83
94
  name: guard-rspec
84
- requirement: &20149680 !ruby/object:Gem::Requirement
95
+ requirement: &70201594491500 !ruby/object:Gem::Requirement
85
96
  none: false
86
97
  requirements:
87
98
  - - ! '>='
@@ -89,10 +100,10 @@ dependencies:
89
100
  version: 0.4.0
90
101
  type: :development
91
102
  prerelease: false
92
- version_requirements: *20149680
103
+ version_requirements: *70201594491500
93
104
  - !ruby/object:Gem::Dependency
94
105
  name: fakeweb
95
- requirement: &20149220 !ruby/object:Gem::Requirement
106
+ requirement: &70201594491040 !ruby/object:Gem::Requirement
96
107
  none: false
97
108
  requirements:
98
109
  - - ! '>='
@@ -100,10 +111,10 @@ dependencies:
100
111
  version: 1.3.0
101
112
  type: :development
102
113
  prerelease: false
103
- version_requirements: *20149220
114
+ version_requirements: *70201594491040
104
115
  - !ruby/object:Gem::Dependency
105
116
  name: vcr
106
- requirement: &20148760 !ruby/object:Gem::Requirement
117
+ requirement: &70201594490580 !ruby/object:Gem::Requirement
107
118
  none: false
108
119
  requirements:
109
120
  - - ! '>='
@@ -111,7 +122,7 @@ dependencies:
111
122
  version: 1.10.2
112
123
  type: :development
113
124
  prerelease: false
114
- version_requirements: *20148760
125
+ version_requirements: *70201594490580
115
126
  description: Neuron Admin Client Gem
116
127
  email:
117
128
  - devteam@rmmonline.com
@@ -169,4 +180,8 @@ rubygems_version: 1.6.2
169
180
  signing_key:
170
181
  specification_version: 3
171
182
  summary: Neuron Admin Client Gem
172
- test_files: []
183
+ test_files:
184
+ - spec/fixtures/vcr_cassettes/s3_file.yml
185
+ - spec/lib/old_spec.rb
186
+ - spec/lib/s3_file_spec.rb
187
+ - spec/spec_helper.rb