eucalyptus 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 485cdd5a1ab888a49685773e0de56b702817ef92
4
- data.tar.gz: d18f3e3a800a663772619b8fba0c1a437bd7fb4a
3
+ metadata.gz: dfecbf0a699698a9c6362b12255eff693caa53c8
4
+ data.tar.gz: 392a295912a4ef2c71eef00f25977077a17a1ba3
5
5
  SHA512:
6
- metadata.gz: f699c5496d353681f5b8e6ae49a648f591fc5b8c357ae2791d0fa8c3a92ad42d90a235c146143157d68a8bd16a0644cadc9ed6052300c6c2bd4d58a057eabc64
7
- data.tar.gz: 4a6946e771678ce08a2b542e1ebe31eeecfdbde241afe13ef39848d3b83178e2b82c0f7c94fd9796f51d2b3245fe598944743be2c8d572ccefbcbf0fc154b117
6
+ metadata.gz: a026a339a283c1eb065ad683d6cf71d5603c07dcee232aed76cae55a43b968bd4b77f4934a939e2fbb57336bcb21c16a918fba08ea757e3cb97525d0fa8b647c
7
+ data.tar.gz: d45520e1b6812ba36a5b0dd43838b9d872922e3357078ceb32fb8c7f8767447c86452045a8a934a86d362150c190eaa5e5469f17df3020cdc85b0ab102b254ef
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/eucalyptus.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: eucalyptus 0.2.0 ruby lib
5
+ # stub: eucalyptus 0.2.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "eucalyptus"
9
- s.version = "0.2.0"
9
+ s.version = "0.2.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Oguz Huner"]
14
- s.date = "2015-06-22"
14
+ s.date = "2015-06-25"
15
15
  s.description = "An easy interface and abstraction to the Facebook Ads API"
16
16
  s.email = "oguzcanhuner@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -28,7 +28,9 @@ module Eucalyptus
28
28
  :spend,
29
29
  :total_action_value,
30
30
  :total_actions,
31
- :total_unique_actions
31
+ :total_unique_actions,
32
+ :cost_per_action_type,
33
+ :action_values
32
34
  ]
33
35
  end
34
36
 
@@ -19,10 +19,14 @@ module Eucalyptus
19
19
  self.new(response)
20
20
  end
21
21
 
22
- def self.all(graph: Eucalyptus.graph, parent: self.parent, fields: [])
23
- fields.concat(self.known_fields).uniq
24
-
25
- response = graph.get_connection(parent.id, api_path, fields: fields)
22
+ def self.all(graph: Eucalyptus.graph, parent: self.parent, options: {})
23
+ if options[:fields]
24
+ options[:fields].concat(self.known_fields).uniq
25
+ else
26
+ options[:fields] = self.known_fields
27
+ end
28
+
29
+ response = graph.get_connection(parent.id, api_path, options)
26
30
  response.collect{ |res| self.new(res) }
27
31
  end
28
32
 
@@ -79,17 +79,31 @@ describe Eucalyptus::Resource do
79
79
  expect(audiences.first).to_not respond_to :random_method
80
80
  end
81
81
 
82
- it 'accepts extra fields' do
82
+ it 'accepts custom fields' do
83
83
  graph = double(:graph)
84
84
  expect(graph).to receive(:get_connection)
85
85
  .with(123, "customaudiences", {fields: [:custom_field, :name, :description]})
86
86
  .and_return([])
87
87
 
88
- Eucalyptus::CustomAudience.all(graph: graph, parent: parent, fields: [:custom_field])
88
+ Eucalyptus::CustomAudience.all(graph: graph, parent: parent, options: {fields: [:custom_field]})
89
+ end
90
+
91
+ it 'accepts any time of option' do
92
+ graph = double(:graph)
93
+ expect(graph).to receive(:get_connection)
94
+ .with(123, "customaudiences", {action_breakdowns: [:custom_field], fields: [:name, :description]})
95
+ .and_return([])
96
+
97
+ Eucalyptus::CustomAudience.all(graph: graph, parent: parent, options: {action_breakdowns: [:custom_field]})
89
98
  end
90
99
  end
91
100
  end
92
101
 
102
+ describe '#update' do
103
+ it 'updates a resource' do
104
+ end
105
+ end
106
+
93
107
  describe '#method_missing' do
94
108
  let(:response) { { "id" => "123", "name" => "Audience", "stats" => {"cpa" => "12"} }}
95
109
  let(:resource) { Eucalyptus::CustomAudience.new(response) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eucalyptus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oguz Huner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-22 00:00:00.000000000 Z
11
+ date: 2015-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: koala