recombee_api_client 0.1.0 → 1.1.0

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: 61ee828200201d0a55afa950d68aae4a68aa7b6a
4
- data.tar.gz: d2bd52cc028a1008cd9a529c7451ffb060754dea
3
+ metadata.gz: 502d27b927763c5c54e373aca3db137df0198683
4
+ data.tar.gz: 0dea5323ad9a5b304bd72a8fe20f590ce8002103
5
5
  SHA512:
6
- metadata.gz: 5a6a691a074c2ef381d7717b1f7da9307c997c442a60e0e1d746c4db85348ec43f1af10b722f58862a4dd30592150274735d336798722f6c3a82a09a8e13ddc6
7
- data.tar.gz: 5df8b96686575ae9db742e46b577ebf8568072c80a747ede138696681d5386b73670c679a03bc5dc28cd649a941f3480eb66f163c302949a75084f6bf08d7565
6
+ metadata.gz: 2787a7a249bf23cb1df46cb9047c6e36e13227677a936c79a87a680547c21829850de8ec2c3dda9083dd9351abd35c3fbdea0d0607da93dae85669138ff6c151
7
+ data.tar.gz: 117af7984b724ada34b5ffac9bbf03e3efbded675733daf76e7ceb79a25b494db5285c8408a33c089f68117940879030cdac28d6e1a53714b627a0324c65734a
@@ -17,20 +17,20 @@ module RecombeeApiClient
17
17
  # * *Required arguments*
18
18
  # - +user_id+ -> User who bookmarked the item
19
19
  # - +item_id+ -> Bookmarked item
20
- # - +timestamp+ -> Unix timestamp of the bookmark. If you don't have the timestamp value available, you may use some artificial value, such as 0. It is preferable, however, to provide the timestamp whenever possible as the user's preferences may evolve over time.
21
20
  #
22
21
  # * *Optional arguments (given as hash optional)*
22
+ # - +timestamp+ -> UTC timestamp of the bookmark as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
23
23
  # - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
24
24
  #
25
- def initialize(user_id, item_id, timestamp, optional = {})
25
+ def initialize(user_id, item_id, optional = {})
26
26
  @user_id = user_id
27
27
  @item_id = item_id
28
- @timestamp = timestamp
28
+ @timestamp = optional['timestamp']
29
29
  @cascade_create = optional['cascadeCreate']
30
30
  @optional = optional
31
31
  @timeout = 1000
32
32
  @optional.each do |par, _|
33
- fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].include? par
33
+ fail UnknownOptionalParameter.new(par) unless ["timestamp","cascadeCreate"].include? par
34
34
  end
35
35
  end
36
36
 
@@ -44,7 +44,7 @@ module RecombeeApiClient
44
44
  p = Hash.new
45
45
  p['userId'] = @user_id
46
46
  p['itemId'] = @item_id
47
- p['timestamp'] = @timestamp
47
+ p['timestamp'] = @optional['timestamp'] if @optional['timestamp']
48
48
  p['cascadeCreate'] = @optional['cascadeCreate'] if @optional['cascadeCreate']
49
49
  p
50
50
  end
@@ -17,20 +17,20 @@ module RecombeeApiClient
17
17
  # * *Required arguments*
18
18
  # - +user_id+ -> User who added the item to the cart
19
19
  # - +item_id+ -> Item added to the cart
20
- # - +timestamp+ -> Unix timestamp of the cart addition. If you don't have the timestamp value available, you may use some artificial value, such as 0. It is preferable, however, to provide the timestamp whenever possible as the user's preferences may evolve over time.
21
20
  #
22
21
  # * *Optional arguments (given as hash optional)*
22
+ # - +timestamp+ -> UTC timestamp of the cart addition as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
23
23
  # - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
24
24
  #
25
- def initialize(user_id, item_id, timestamp, optional = {})
25
+ def initialize(user_id, item_id, optional = {})
26
26
  @user_id = user_id
27
27
  @item_id = item_id
28
- @timestamp = timestamp
28
+ @timestamp = optional['timestamp']
29
29
  @cascade_create = optional['cascadeCreate']
30
30
  @optional = optional
31
31
  @timeout = 1000
32
32
  @optional.each do |par, _|
33
- fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].include? par
33
+ fail UnknownOptionalParameter.new(par) unless ["timestamp","cascadeCreate"].include? par
34
34
  end
35
35
  end
36
36
 
@@ -44,7 +44,7 @@ module RecombeeApiClient
44
44
  p = Hash.new
45
45
  p['userId'] = @user_id
46
46
  p['itemId'] = @item_id
47
- p['timestamp'] = @timestamp
47
+ p['timestamp'] = @optional['timestamp'] if @optional['timestamp']
48
48
  p['cascadeCreate'] = @optional['cascadeCreate'] if @optional['cascadeCreate']
49
49
  p
50
50
  end
@@ -17,22 +17,22 @@ module RecombeeApiClient
17
17
  # * *Required arguments*
18
18
  # - +user_id+ -> User who viewed the item
19
19
  # - +item_id+ -> Viewed item
20
- # - +timestamp+ -> Unix timestamp of the view. If you don't have the timestamp value available, you may use some artificial value, such as 0. It is preferable, however, to provide the timestamp whenever possible as the user's preferences may evolve over time.
21
20
  #
22
21
  # * *Optional arguments (given as hash optional)*
22
+ # - +timestamp+ -> UTC timestamp of the view as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
23
23
  # - +duration+ -> Duration of the view
24
24
  # - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
25
25
  #
26
- def initialize(user_id, item_id, timestamp, optional = {})
26
+ def initialize(user_id, item_id, optional = {})
27
27
  @user_id = user_id
28
28
  @item_id = item_id
29
- @timestamp = timestamp
29
+ @timestamp = optional['timestamp']
30
30
  @duration = optional['duration']
31
31
  @cascade_create = optional['cascadeCreate']
32
32
  @optional = optional
33
33
  @timeout = 1000
34
34
  @optional.each do |par, _|
35
- fail UnknownOptionalParameter.new(par) unless ["duration","cascadeCreate"].include? par
35
+ fail UnknownOptionalParameter.new(par) unless ["timestamp","duration","cascadeCreate"].include? par
36
36
  end
37
37
  end
38
38
 
@@ -46,7 +46,7 @@ module RecombeeApiClient
46
46
  p = Hash.new
47
47
  p['userId'] = @user_id
48
48
  p['itemId'] = @item_id
49
- p['timestamp'] = @timestamp
49
+ p['timestamp'] = @optional['timestamp'] if @optional['timestamp']
50
50
  p['duration'] = @optional['duration'] if @optional['duration']
51
51
  p['cascadeCreate'] = @optional['cascadeCreate'] if @optional['cascadeCreate']
52
52
  p
@@ -17,20 +17,20 @@ module RecombeeApiClient
17
17
  # * *Required arguments*
18
18
  # - +user_id+ -> User who purchased the item
19
19
  # - +item_id+ -> Purchased item
20
- # - +timestamp+ -> Unix timestamp of the purchase. If you don't have the timestamp value available, you may use some artificial value, such as 0. It is preferable, however, to provide the timestamp whenever possible as the user's preferences may evolve over time.
21
20
  #
22
21
  # * *Optional arguments (given as hash optional)*
22
+ # - +timestamp+ -> UTC timestamp of the purchase as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
23
23
  # - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
24
24
  #
25
- def initialize(user_id, item_id, timestamp, optional = {})
25
+ def initialize(user_id, item_id, optional = {})
26
26
  @user_id = user_id
27
27
  @item_id = item_id
28
- @timestamp = timestamp
28
+ @timestamp = optional['timestamp']
29
29
  @cascade_create = optional['cascadeCreate']
30
30
  @optional = optional
31
31
  @timeout = 1000
32
32
  @optional.each do |par, _|
33
- fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].include? par
33
+ fail UnknownOptionalParameter.new(par) unless ["timestamp","cascadeCreate"].include? par
34
34
  end
35
35
  end
36
36
 
@@ -44,7 +44,7 @@ module RecombeeApiClient
44
44
  p = Hash.new
45
45
  p['userId'] = @user_id
46
46
  p['itemId'] = @item_id
47
- p['timestamp'] = @timestamp
47
+ p['timestamp'] = @optional['timestamp'] if @optional['timestamp']
48
48
  p['cascadeCreate'] = @optional['cascadeCreate'] if @optional['cascadeCreate']
49
49
  p
50
50
  end
@@ -17,22 +17,22 @@ module RecombeeApiClient
17
17
  # * *Required arguments*
18
18
  # - +user_id+ -> User who submitted the rating
19
19
  # - +item_id+ -> Rated item
20
- # - +timestamp+ -> Unix timestamp of the rating. If you don't have the timestamp value available, you may use some artificial value, such as 0. It is preferable, however, to provide the timestamp whenever possible as the user's preferences may evolve over time.
21
20
  # - +rating+ -> Rating rescaled to interval [-1.0,1.0], where -1.0 means the worst rating possible, 0.0 means neutral, and 1.0 means absolutely positive rating. For example, in the case of 5-star evaluations, rating = (numStars-3)/2 formula may be used for the conversion.
22
21
  #
23
22
  # * *Optional arguments (given as hash optional)*
23
+ # - +timestamp+ -> UTC timestamp of the rating as ISO8601-1 pattern or UTC epoch time. The default value is the current time.
24
24
  # - +cascadeCreate+ -> Sets whether the given user/item should be created if not present in the database.
25
25
  #
26
- def initialize(user_id, item_id, timestamp, rating, optional = {})
26
+ def initialize(user_id, item_id, rating, optional = {})
27
27
  @user_id = user_id
28
28
  @item_id = item_id
29
- @timestamp = timestamp
30
29
  @rating = rating
30
+ @timestamp = optional['timestamp']
31
31
  @cascade_create = optional['cascadeCreate']
32
32
  @optional = optional
33
33
  @timeout = 1000
34
34
  @optional.each do |par, _|
35
- fail UnknownOptionalParameter.new(par) unless ["cascadeCreate"].include? par
35
+ fail UnknownOptionalParameter.new(par) unless ["timestamp","cascadeCreate"].include? par
36
36
  end
37
37
  end
38
38
 
@@ -46,8 +46,8 @@ module RecombeeApiClient
46
46
  p = Hash.new
47
47
  p['userId'] = @user_id
48
48
  p['itemId'] = @item_id
49
- p['timestamp'] = @timestamp
50
49
  p['rating'] = @rating
50
+ p['timestamp'] = @optional['timestamp'] if @optional['timestamp']
51
51
  p['cascadeCreate'] = @optional['cascadeCreate'] if @optional['cascadeCreate']
52
52
  p
53
53
  end
@@ -54,9 +54,11 @@ module RecombeeApiClient
54
54
  'path' => path
55
55
  }
56
56
  params = req.query_parameters
57
+
57
58
  if req.body_parameters
58
59
  params = params.merge(req.body_parameters)
59
60
  end
61
+
60
62
  bh['params'] = params if params.size > 0
61
63
  bh
62
64
  end
@@ -1,3 +1,3 @@
1
1
  module RecombeeApiClient
2
- VERSION = '0.1.0'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recombee_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Fiedler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-05 00:00:00.000000000 Z
11
+ date: 2016-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json