zanoxrb 0.5.3 → 0.5.4

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: 7fcd8165b965f5bc64f78ba1e67498994099f280
4
- data.tar.gz: ca5f903829e1c2d29384ac0db4955a127f8cc259
3
+ metadata.gz: d25416b2971e7067a80da8e23d5de8c3780b2aa0
4
+ data.tar.gz: c2aa71c7209d35eb474f99d96a7f835ca1c531a2
5
5
  SHA512:
6
- metadata.gz: 7cc4f1c9cf140846bd2b3bef75e43609004e08c1ba95db621ef59d91d66cca124cce35aa61209d8fec4ac756be2c5d8f03d95303c435904fff7c3f0271a023ca
7
- data.tar.gz: 674f79a0c9f1e80a7fbdaf97d7a039d76d72807e807c609a64dfcc7711f07b8c8867f212a2e48cbb7c2ed643daff79b99c73299bc9039bb5681c49f003900a38
6
+ metadata.gz: ab37f62795cc3adea8ca488b7a30b393280485bf87af27fd6d52c7a37f766be51a22c6878e97dc88e8d4c22382212a23e349a8805cc63bed389f7c526d2aad6a
7
+ data.tar.gz: 77c7bee4ada16014cd00746128f22aa58e84b9c13895e089d5c2f5fed78d41327a652d15b07c060036b715c0ba7fe885b50b8c0a5fc888dc9785b47c4703cc60
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ zanox-rbx
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zanoxrb (0.5.3)
4
+ zanoxrb (0.5.4)
5
5
  httparty (~> 0.13)
6
6
  ruby-try (~> 1.1)
7
7
 
@@ -0,0 +1,59 @@
1
+ #--
2
+ # Copyright(C) 2015 Giovanni Capuano <webmaster@giovannicapuano.net>
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # THIS SOFTWARE IS PROVIDED BY Giovanni Capuano ''AS IS'' AND ANY EXPRESS OR IMPLIED
11
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
12
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Giovanni Capuano OR
13
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
14
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
15
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
16
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
17
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
18
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
+ #
20
+ # The views and conclusions contained in the software and documentation are those of the
21
+ # authors and should not be interpreted as representing official policies, either expressed
22
+ # or implied, of Giovanni Capuano.
23
+ #++
24
+
25
+ module Zanox
26
+ class TrackingCategories < Item
27
+ attr_reader :pid, :program, :adspace, :transaction_type, :sale_fixed, :sale_percent
28
+
29
+ ###################
30
+ # - pid (Integer) AdSpace ID
31
+ # - program (Hash) The program in input
32
+ # - adspace (Hash) The adspace in input
33
+ # - transaction_type (String) The type of the transaction (leads, sales)
34
+ # - sale_fixed (Float) The fixed value of the sale
35
+ # - sale_percent (Float) The percent value of the sale
36
+ ###################
37
+ def initialize(data)
38
+ @pid = data['@id'].to_i
39
+ @program = {
40
+ id: data['program']['@id'].to_i,
41
+ name: data['program']['$']
42
+ }
43
+ @adspace = {
44
+ id: data['adspace']['@id'].to_i,
45
+ name: data['adspace']['$']
46
+ }
47
+ @transaction_type = data['transactionType']
48
+ @sale_fixed = data['sale_fixed']
49
+ @sale_percent = data['sale_percent']
50
+ end
51
+
52
+ class << self
53
+ def find(program_id, adspace_id)
54
+ response = API.request("programapplications/program/#{program_id}/adspace/#{adspace_id}/trackingcategories")
55
+ response.tracking_category_item.map { |tracking_category| new(tracking_category) }
56
+ end
57
+ end
58
+ end
59
+ end
data/lib/zanox/version.rb CHANGED
@@ -23,5 +23,5 @@
23
23
  #++
24
24
 
25
25
  module Zanox
26
- VERSION = '0.5.3'
26
+ VERSION = '0.5.4'
27
27
  end
data/lib/zanox.rb CHANGED
@@ -37,6 +37,7 @@ require 'zanox/resources/item'
37
37
  require 'zanox/resources/adspace'
38
38
  require 'zanox/resources/product'
39
39
  require 'zanox/resources/program_application'
40
+ require 'zanox/resources/tracking_category'
40
41
  require 'zanox/resources/shop'
41
42
 
42
43
  require 'zanox/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zanoxrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-02 00:00:00.000000000 Z
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  version_requirements: !ruby/object:Gem::Requirement
@@ -88,6 +88,7 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - ".gitignore"
91
+ - ".ruby-gemset"
91
92
  - ".travis.yml"
92
93
  - Gemfile
93
94
  - Gemfile.lock
@@ -104,6 +105,7 @@ files:
104
105
  - lib/zanox/resources/product.rb
105
106
  - lib/zanox/resources/program_application.rb
106
107
  - lib/zanox/resources/shop.rb
108
+ - lib/zanox/resources/tracking_category.rb
107
109
  - lib/zanox/response.rb
108
110
  - lib/zanox/session.rb
109
111
  - lib/zanox/version.rb