attune 1.0.12 → 1.0.13

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: 3864ecede09a3148c23d49737275d5c49486b6b0
4
- data.tar.gz: 42197d4441dec9a6ba768c83323888f9c475429e
3
+ metadata.gz: c91111fff65966e1117046d7a8f3d2a262eca13f
4
+ data.tar.gz: a0d7fc673c1a7208a92fb9a1b53d94c8b7c33514
5
5
  SHA512:
6
- metadata.gz: ec73bb2719d24b224d44beae11f2bd66a3b78676e57ec311fa0419ac24de71d82ed0868db15e21d9b94b5c746b30a94a87a10b06f103a5e93d79ec16d7e4120a
7
- data.tar.gz: 94e15e68ff09a9add6a480ccbc2a2b9e17fc4cedf30f5635a4f5d0cea59560529a6160c034b9934ad63007c0882110f95f3b7ddbfee71141443d32574f6621b5
6
+ metadata.gz: 2ab1ce48fe422fbad0d6aae4aa95a0c61bebb60dfe7a4de31ba1fb728d8ed98db53adf56cb7d2fd6f1501bd3e29401fd1bf28b8551e7e9ccb93edede5af1c501
7
+ data.tar.gz: 5e17a31b4ed44a06264025e81f3cc046b6c5f61d29b13e22da1cd1b78adda69120d53d84e200c09bb3ee5d2f82ee0aa88626dcfd3b1093a7d7132d9fef612610
data/README.md CHANGED
@@ -71,6 +71,10 @@ class ProductsController
71
71
  ranking_params.entity_type = 'products'
72
72
  ranking_params.user_agent = request.env["HTTP_USER_AGENT"]
73
73
  ranking_params.ids = products.map(&:id)
74
+ scope = Attune::Model::ScopeEntry.new
75
+ scope.name = 'category'
76
+ scope.value = 'pants'
77
+ ranking_params.scope = [scope]
74
78
  ranking = attune_client.entities.get_rankings(ranking_params)
75
79
  products.sort_by do |product|
76
80
  ranking.ranking.index(product.id.to_s)
@@ -3,44 +3,44 @@ module Attune
3
3
  #
4
4
  #
5
5
  # @attr [String] id
6
+ # @attr [Boolean] disabled
6
7
  # @attr [String] entity_type
7
- # @attr [String] consumer
8
8
  # @attr [String] start_date
9
- # @attr [String] created_date
10
- # @attr [String] updated_date
11
9
  # @attr [String] end_date
12
- # @attr [Array<String>] scope
10
+ # @attr [String] consumer
13
11
  # @attr [Array<String>] ids
14
- # @attr [Boolean] disabled
12
+ # @attr [String] created_date
13
+ # @attr [String] updated_date
14
+ # @attr [String] scope
15
15
  class Blacklist
16
16
  attr_accessor :id
17
17
 
18
18
 
19
- attr_accessor :entity_type
19
+ attr_accessor :disabled
20
20
 
21
21
 
22
- attr_accessor :consumer
22
+ attr_accessor :entity_type
23
23
 
24
24
 
25
25
  attr_accessor :start_date
26
26
 
27
27
 
28
- attr_accessor :created_date
28
+ attr_accessor :end_date
29
29
 
30
30
 
31
- attr_accessor :updated_date
31
+ attr_accessor :consumer
32
32
 
33
33
 
34
- attr_accessor :end_date
34
+ attr_accessor :ids
35
35
 
36
36
 
37
- attr_accessor :scope
37
+ attr_accessor :created_date
38
38
 
39
39
 
40
- attr_accessor :ids
40
+ attr_accessor :updated_date
41
41
 
42
42
 
43
- attr_accessor :disabled
43
+ attr_accessor :scope
44
44
 
45
45
 
46
46
  def initialize(attributes = {})
@@ -48,29 +48,26 @@ module Attune
48
48
  # Workaround since JSON.parse has accessors as strings rather than symbols
49
49
  @id = attributes["id"] || attributes[:"id"]
50
50
  # Workaround since JSON.parse has accessors as strings rather than symbols
51
- @entity_type = attributes["entityType"] || attributes[:"entity_type"]
51
+ @disabled = attributes["disabled"] || attributes[:"disabled"]
52
52
  # Workaround since JSON.parse has accessors as strings rather than symbols
53
- @consumer = attributes["consumer"] || attributes[:"consumer"]
53
+ @entity_type = attributes["entityType"] || attributes[:"entity_type"]
54
54
  # Workaround since JSON.parse has accessors as strings rather than symbols
55
55
  @start_date = attributes["startDate"] || attributes[:"start_date"]
56
56
  # Workaround since JSON.parse has accessors as strings rather than symbols
57
- @created_date = attributes["createdDate"] || attributes[:"created_date"]
58
- # Workaround since JSON.parse has accessors as strings rather than symbols
59
- @updated_date = attributes["updatedDate"] || attributes[:"updated_date"]
60
- # Workaround since JSON.parse has accessors as strings rather than symbols
61
57
  @end_date = attributes["endDate"] || attributes[:"end_date"]
62
- value = attributes["scope"] || attributes[:"scope"]
63
- if value.is_a?(Array)
64
- @scope = value
65
-
66
- end
58
+ # Workaround since JSON.parse has accessors as strings rather than symbols
59
+ @consumer = attributes["consumer"] || attributes[:"consumer"]
67
60
  value = attributes["ids"] || attributes[:"ids"]
68
61
  if value.is_a?(Array)
69
62
  @ids = value
70
63
 
71
64
  end
72
65
  # Workaround since JSON.parse has accessors as strings rather than symbols
73
- @disabled = attributes["disabled"] || attributes[:"disabled"]
66
+ @created_date = attributes["createdDate"] || attributes[:"created_date"]
67
+ # Workaround since JSON.parse has accessors as strings rather than symbols
68
+ @updated_date = attributes["updatedDate"] || attributes[:"updated_date"]
69
+ # Workaround since JSON.parse has accessors as strings rather than symbols
70
+ @scope = attributes["scope"] || attributes[:"scope"]
74
71
 
75
72
 
76
73
  end
@@ -90,15 +87,15 @@ module Attune
90
87
  # :internal => :external
91
88
  ATTRIBUTE_MAP = {
92
89
  :id => :id,
90
+ :disabled => :disabled,
93
91
  :entity_type => :entityType,
94
- :consumer => :consumer,
95
92
  :start_date => :startDate,
96
- :created_date => :createdDate,
97
- :updated_date => :updatedDate,
98
93
  :end_date => :endDate,
99
- :scope => :scope,
94
+ :consumer => :consumer,
100
95
  :ids => :ids,
101
- :disabled => :disabled
96
+ :created_date => :createdDate,
97
+ :updated_date => :updatedDate,
98
+ :scope => :scope
102
99
 
103
100
  }
104
101
  end
@@ -2,23 +2,23 @@ module Attune
2
2
  module Model
3
3
  #
4
4
  #
5
+ # @attr [Array<Attune::Model::ScopeEntry>] scope
6
+ # @attr [String] entity_type
5
7
  # @attr [Array<String>] ids
6
8
  # @attr [Boolean] disabled
7
- # @attr [String] entity_type
8
- # @attr [Array<Attune::Model::ScopeEntry>] scope
9
9
  # @attr [String] active_from
10
10
  # @attr [String] active_to
11
11
  class BlacklistParams
12
- attr_accessor :ids
12
+ attr_accessor :scope
13
13
 
14
14
 
15
- attr_accessor :disabled
15
+ attr_accessor :entity_type
16
16
 
17
17
 
18
- attr_accessor :entity_type
18
+ attr_accessor :ids
19
19
 
20
20
 
21
- attr_accessor :scope
21
+ attr_accessor :disabled
22
22
 
23
23
 
24
24
  attr_accessor :active_from
@@ -29,21 +29,21 @@ module Attune
29
29
 
30
30
  def initialize(attributes = {})
31
31
  return if attributes.empty?
32
- value = attributes["ids"] || attributes[:"ids"]
32
+ value = attributes["scope"] || attributes[:"scope"]
33
33
  if value.is_a?(Array)
34
- @ids = value
34
+ @scope = value.map{ |v| ScopeEntry.new(v) }
35
35
 
36
36
  end
37
37
  # Workaround since JSON.parse has accessors as strings rather than symbols
38
- @disabled = attributes["disabled"] || attributes[:"disabled"]
39
- # Workaround since JSON.parse has accessors as strings rather than symbols
40
38
  @entity_type = attributes["entityType"] || attributes[:"entity_type"]
41
- value = attributes["scope"] || attributes[:"scope"]
39
+ value = attributes["ids"] || attributes[:"ids"]
42
40
  if value.is_a?(Array)
43
- @scope = value.map{ |v| ScopeEntry.new(v) }
41
+ @ids = value
44
42
 
45
43
  end
46
44
  # Workaround since JSON.parse has accessors as strings rather than symbols
45
+ @disabled = attributes["disabled"] || attributes[:"disabled"]
46
+ # Workaround since JSON.parse has accessors as strings rather than symbols
47
47
  @active_from = attributes["activeFrom"] || attributes[:"active_from"]
48
48
  # Workaround since JSON.parse has accessors as strings rather than symbols
49
49
  @active_to = attributes["activeTo"] || attributes[:"active_to"]
@@ -65,10 +65,10 @@ module Attune
65
65
  private
66
66
  # :internal => :external
67
67
  ATTRIBUTE_MAP = {
68
+ :scope => :scope,
69
+ :entity_type => :entityType,
68
70
  :ids => :ids,
69
71
  :disabled => :disabled,
70
- :entity_type => :entityType,
71
- :scope => :scope,
72
72
  :active_from => :activeFrom,
73
73
  :active_to => :activeTo
74
74
 
@@ -4,6 +4,7 @@ module Attune
4
4
  #
5
5
  # @attr [String] message Error message if ranking failed
6
6
  # @attr [Integer] status HTTP status code if ranking failed
7
+ # @attr [String] cell Cell assignment
7
8
  # @attr [Array<String>] ranking List of ids in ranked order
8
9
  class RankedEntities
9
10
  attr_accessor :message
@@ -12,6 +13,9 @@ module Attune
12
13
  attr_accessor :status
13
14
 
14
15
 
16
+ attr_accessor :cell
17
+
18
+
15
19
  attr_accessor :ranking
16
20
 
17
21
 
@@ -21,6 +25,8 @@ module Attune
21
25
  @message = attributes["message"] || attributes[:"message"]
22
26
  # Workaround since JSON.parse has accessors as strings rather than symbols
23
27
  @status = attributes["status"] || attributes[:"status"]
28
+ # Workaround since JSON.parse has accessors as strings rather than symbols
29
+ @cell = attributes["cell"] || attributes[:"cell"]
24
30
  value = attributes["ranking"] || attributes[:"ranking"]
25
31
  if value.is_a?(Array)
26
32
  @ranking = value
@@ -46,6 +52,7 @@ module Attune
46
52
  ATTRIBUTE_MAP = {
47
53
  :message => :message,
48
54
  :status => :status,
55
+ :cell => :cell,
49
56
  :ranking => :ranking
50
57
 
51
58
  }
@@ -2,63 +2,72 @@ module Attune
2
2
  module Model
3
3
  # Inputs for ranking a set of ids for a particular user.
4
4
  #
5
+ # @attr [String] anonymous
6
+ # @attr [String] view
5
7
  # @attr [String] user_agent
6
8
  # @attr [String] ip
7
- # @attr [Array<String>] ids
8
- # @attr [String] view
9
+ # @attr [Array<String>] quantities
10
+ # @attr [Array<Attune::Model::ScopeEntry>] scope
9
11
  # @attr [String] entity_type
12
+ # @attr [Array<String>] ids
10
13
  # @attr [String] customer
11
- # @attr [Array<Attune::Model::ScopeEntry>] scope
12
- # @attr [String] anonymous
13
14
  class RankingParams
15
+ attr_accessor :anonymous
16
+
17
+
18
+ attr_accessor :view
19
+
20
+
14
21
  attr_accessor :user_agent
15
22
 
16
23
 
17
24
  attr_accessor :ip
18
25
 
19
26
 
20
- attr_accessor :ids
27
+ attr_accessor :quantities
21
28
 
22
29
 
23
- attr_accessor :view
30
+ attr_accessor :scope
24
31
 
25
32
 
26
33
  attr_accessor :entity_type
27
34
 
28
35
 
29
- attr_accessor :customer
30
-
31
-
32
- attr_accessor :scope
36
+ attr_accessor :ids
33
37
 
34
38
 
35
- attr_accessor :anonymous
39
+ attr_accessor :customer
36
40
 
37
41
 
38
42
  def initialize(attributes = {})
39
43
  return if attributes.empty?
40
44
  # Workaround since JSON.parse has accessors as strings rather than symbols
45
+ @anonymous = attributes["anonymous"] || attributes[:"anonymous"]
46
+ # Workaround since JSON.parse has accessors as strings rather than symbols
47
+ @view = attributes["view"] || attributes[:"view"]
48
+ # Workaround since JSON.parse has accessors as strings rather than symbols
41
49
  @user_agent = attributes["userAgent"] || attributes[:"user_agent"]
42
50
  # Workaround since JSON.parse has accessors as strings rather than symbols
43
51
  @ip = attributes["ip"] || attributes[:"ip"]
44
- value = attributes["ids"] || attributes[:"ids"]
52
+ value = attributes["quantities"] || attributes[:"quantities"]
45
53
  if value.is_a?(Array)
46
- @ids = value
54
+ @quantities = value
47
55
 
48
56
  end
49
- # Workaround since JSON.parse has accessors as strings rather than symbols
50
- @view = attributes["view"] || attributes[:"view"]
51
- # Workaround since JSON.parse has accessors as strings rather than symbols
52
- @entity_type = attributes["entityType"] || attributes[:"entity_type"]
53
- # Workaround since JSON.parse has accessors as strings rather than symbols
54
- @customer = attributes["customer"] || attributes[:"customer"]
55
57
  value = attributes["scope"] || attributes[:"scope"]
56
58
  if value.is_a?(Array)
57
59
  @scope = value.map{ |v| ScopeEntry.new(v) }
58
60
 
59
61
  end
60
62
  # Workaround since JSON.parse has accessors as strings rather than symbols
61
- @anonymous = attributes["anonymous"] || attributes[:"anonymous"]
63
+ @entity_type = attributes["entityType"] || attributes[:"entity_type"]
64
+ value = attributes["ids"] || attributes[:"ids"]
65
+ if value.is_a?(Array)
66
+ @ids = value
67
+
68
+ end
69
+ # Workaround since JSON.parse has accessors as strings rather than symbols
70
+ @customer = attributes["customer"] || attributes[:"customer"]
62
71
 
63
72
 
64
73
  end
@@ -77,14 +86,15 @@ module Attune
77
86
  private
78
87
  # :internal => :external
79
88
  ATTRIBUTE_MAP = {
89
+ :anonymous => :anonymous,
90
+ :view => :view,
80
91
  :user_agent => :userAgent,
81
92
  :ip => :ip,
82
- :ids => :ids,
83
- :view => :view,
84
- :entity_type => :entityType,
85
- :customer => :customer,
93
+ :quantities => :quantities,
86
94
  :scope => :scope,
87
- :anonymous => :anonymous
95
+ :entity_type => :entityType,
96
+ :ids => :ids,
97
+ :customer => :customer
88
98
 
89
99
  }
90
100
  end
@@ -1,4 +1,4 @@
1
1
  module Attune
2
- VERSION = "1.0.12"
2
+ VERSION = "1.0.13"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attune
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn
@@ -9,118 +9,118 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-06 00:00:00.000000000 Z
12
+ date: 2014-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0.8'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0.8'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: net-http-persistent
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - '>='
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - '>='
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: bundler
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ~>
47
47
  - !ruby/object:Gem::Version
48
48
  version: '1.2'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ~>
54
54
  - !ruby/object:Gem::Version
55
55
  version: '1.2'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ">="
60
+ - - '>='
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ">="
67
+ - - '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ">="
74
+ - - '>='
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ">="
81
+ - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: yard
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ">="
88
+ - - '>='
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - '>='
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: redcarpet
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - '>='
103
103
  - !ruby/object:Gem::Version
104
104
  version: 3.1.1
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ">="
109
+ - - '>='
110
110
  - !ruby/object:Gem::Version
111
111
  version: 3.1.1
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: simplecov
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - ">="
116
+ - - '>='
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ">="
123
+ - - '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  description: Client for the Attune product ranking API.
@@ -131,9 +131,9 @@ executables: []
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
- - ".gitignore"
135
- - ".rspec"
136
- - ".yardopts"
134
+ - .gitignore
135
+ - .rspec
136
+ - .yardopts
137
137
  - Gemfile
138
138
  - Guardfile
139
139
  - LICENSE.txt
@@ -183,17 +183,17 @@ require_paths:
183
183
  - lib
184
184
  required_ruby_version: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - ">="
186
+ - - '>='
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - ">="
191
+ - - '>='
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
- rubygems_version: 2.2.2
196
+ rubygems_version: 2.3.0
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Client for the Attune product ranking API.