sifiapi 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,8 +72,8 @@ class SifiApi::Resource
72
72
  resource = self.new(record, connection, user_key)
73
73
  a << resource
74
74
  end
75
+ SifiApi::ResourceCollection.new(resource_name, a, response.body["paging"], connection, user_key)
75
76
  end
76
- SifiApi::ResourceCollection.new(resource_name, a, response.body["paging"], connection, user_key)
77
77
  end
78
78
 
79
79
  def method_missing(sym, *args, &block)
@@ -90,13 +90,13 @@ class SifiApi::Resource
90
90
  end
91
91
  end
92
92
 
93
-
94
93
  def do_action(action)
95
94
  execute_with_rescue do
96
95
  response = @connection.send(action["method"].downcase, @user_key, action["href"])
97
96
  if response && response.status == 200
98
- if response[:content_type] == "application/json"
97
+ if response[:content_type].include?("application/json")
99
98
  @json = response.body[resource_name].first
99
+ return self
100
100
  elsif ["text/csv", "application/zip"].include?(response[:content_type])
101
101
  filename = response.headers[:content_disposition].match(/filename="(.+)"/)[1]
102
102
  file = Tempfile.new(filename)
@@ -1,7 +1,7 @@
1
1
  module SifiApi
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 11
4
+ MINOR = 12
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
data/lib/sifi_api.rb CHANGED
@@ -11,7 +11,6 @@ module SifiApi
11
11
  autoload :AdFileType, "sifi_api/ad_file_type"
12
12
  autoload :AdSize, "sifi_api/ad_size"
13
13
  autoload :BidType, "sifi_api/bid_type"
14
- autoload :BrandedDatum, "sifi_api/branded_datum"
15
14
  autoload :Browser, "sifi_api/browser"
16
15
  autoload :Campaign, "sifi_api/campaign"
17
16
  autoload :CampaignStat, "sifi_api/campaign_stat"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sifiapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-30 00:00:00.000000000Z
12
+ date: 2012-09-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
- requirement: &2152988800 !ruby/object:Gem::Requirement
16
+ requirement: &2154035060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.7.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152988800
24
+ version_requirements: *2154035060
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: multi_json
27
- requirement: &2152986920 !ruby/object:Gem::Requirement
27
+ requirement: &2154034300 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152986920
35
+ version_requirements: *2154034300
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
38
- requirement: &2152985560 !ruby/object:Gem::Requirement
38
+ requirement: &2154033680 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 3.0.10
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2152985560
46
+ version_requirements: *2154033680
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: i18n
49
- requirement: &2152983920 !ruby/object:Gem::Requirement
49
+ requirement: &2154032760 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 0.5.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2152983920
57
+ version_requirements: *2154032760
58
58
  description: ''
59
59
  email:
60
60
  - brandon@simpli.fi
@@ -77,7 +77,6 @@ files:
77
77
  - lib/sifi_api/ad_file_type.rb
78
78
  - lib/sifi_api/ad_size.rb
79
79
  - lib/sifi_api/bid_type.rb
80
- - lib/sifi_api/branded_datum.rb
81
80
  - lib/sifi_api/browser.rb
82
81
  - lib/sifi_api/campaign.rb
83
82
  - lib/sifi_api/campaign_stat.rb
@@ -112,7 +111,6 @@ files:
112
111
  - spec/sifi_api/ad_size_spec.rb
113
112
  - spec/sifi_api/ad_spec.rb
114
113
  - spec/sifi_api/bid_type_spec.rb
115
- - spec/sifi_api/branded_datum_spec.rb
116
114
  - spec/sifi_api/browser_spec.rb
117
115
  - spec/sifi_api/campaign_spec.rb
118
116
  - spec/sifi_api/campaign_stat_spec.rb
@@ -121,7 +119,6 @@ files:
121
119
  - spec/sifi_api/client_spec.rb
122
120
  - spec/sifi_api/company_spec.rb
123
121
  - spec/sifi_api/context_spec.rb
124
- - spec/sifi_api/dayparting_spec.rb
125
122
  - spec/sifi_api/device_spec.rb
126
123
  - spec/sifi_api/dma_spec.rb
127
124
  - spec/sifi_api/domain_spec.rb
@@ -168,7 +165,6 @@ test_files:
168
165
  - spec/sifi_api/ad_size_spec.rb
169
166
  - spec/sifi_api/ad_spec.rb
170
167
  - spec/sifi_api/bid_type_spec.rb
171
- - spec/sifi_api/branded_datum_spec.rb
172
168
  - spec/sifi_api/browser_spec.rb
173
169
  - spec/sifi_api/campaign_spec.rb
174
170
  - spec/sifi_api/campaign_stat_spec.rb
@@ -177,7 +173,6 @@ test_files:
177
173
  - spec/sifi_api/client_spec.rb
178
174
  - spec/sifi_api/company_spec.rb
179
175
  - spec/sifi_api/context_spec.rb
180
- - spec/sifi_api/dayparting_spec.rb
181
176
  - spec/sifi_api/device_spec.rb
182
177
  - spec/sifi_api/dma_spec.rb
183
178
  - spec/sifi_api/domain_spec.rb
@@ -1,2 +0,0 @@
1
- class SifiApi::BrandedDatum < SifiApi::Resource
2
- end
@@ -1,7 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe SifiApi::BrandedDatum do
4
-
5
- it_should_behave_like "SifiApi::Resource", SifiApi::BrandedDatum
6
-
7
- end
@@ -1,7 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe SifiApi::Dayparting do
4
-
5
- it_should_behave_like "SifiApi::Resource", SifiApi::Dayparting
6
-
7
- end