Skip to content

Commit d084ff5

Browse files
committed
Updated examples
1 parent 457a6d2 commit d084ff5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ begin
4949
puts 'Send items'
5050
client.send(Batch.new(my_items.map { |itemId| AddItem.new(itemId) }))
5151
puts 'Send purchases'
52-
client.send(Batch.new(my_purchases.map { |p| AddPurchase.new(p['userId'], p['itemId'], 0) }))
52+
client.send(Batch.new(my_purchases.map { |p| AddPurchase.new(p['userId'], p['itemId']) }))
5353

5454
# Get recommendations for user 'user-25'
5555
puts 'Recommend for a user'
@@ -62,8 +62,6 @@ end
6262

6363
### Using property values
6464
```ruby
65-
#!/usr/bin/env ruby
66-
6765
require 'recombee_api_client'
6866
include RecombeeApiClient
6967

@@ -107,7 +105,7 @@ requests = []
107105
user_ids = (1..NUM).map{|i| "user-#{i}"}
108106
user_ids = user_ids.select { |_| rand(0.0..1.0) < PROBABILITY_PURCHASED }
109107
# Use cascadeCreate to create unexisting users
110-
user_ids.each { |user_id| requests.push(AddPurchase.new(user_id, item_id, 0, 'cascadeCreate' => true)) }
108+
user_ids.each { |user_id| requests.push(AddPurchase.new(user_id, item_id, 'cascadeCreate' => true)) }
111109
end
112110

113111
# Send purchases to the recommender system

0 commit comments

Comments
 (0)