Module: Mercadolibre::Core::Metrics
- Included in:
- Api
- Defined in:
- lib/mercadolibre/core/metrics.rb
Instance Method Summary collapse
- #get_item_visits_tw(item_id, args = {}) ⇒ Object
- #get_items_visits(item_ids, args = {}) ⇒ Object
- #get_total_items_visits(item_ids) ⇒ Object
- #get_user_items_see_phone_clicked_quantities_tw(item_ids, args) ⇒ Object
- #get_user_question_quantities(user_id, args = {}) ⇒ Object
- #get_user_question_quantities_tw(user_id, args = {}) ⇒ Object
- #get_user_see_phone_clicked_quantities(user_id, args = {}) ⇒ Object
- #get_user_see_phone_clicked_quantities_tw(user_id, args = {}) ⇒ Object
- #get_user_visits(user_id, args = {}) ⇒ Object
- #get_user_visits_tw(user_id, args = {}) ⇒ Object
Instance Method Details
#get_item_visits_tw(item_id, args = {}) ⇒ Object
33 34 35 |
# File 'lib/mercadolibre/core/metrics.rb', line 33 def get_item_visits_tw(item_id, args={}) get_request("/items/#{item_id}/visits/time_window", args).body end |
#get_items_visits(item_ids, args = {}) ⇒ Object
28 29 30 31 |
# File 'lib/mercadolibre/core/metrics.rb', line 28 def get_items_visits(item_ids, args={}) item_ids_desc = (item_ids.is_a?(Array) ? item_ids.join(',') : item_ids) get_request("/items/visits", args.merge(ids: item_ids_desc)).body end |
#get_total_items_visits(item_ids) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mercadolibre/core/metrics.rb', line 37 def get_total_items_visits(item_ids) if item_ids.is_a? Array result = { } item_ids.each_slice(50) do |ids_group| filters = { ids: ids_group.join(',') } result.merge!(get_request('/visits/items', filters, { api_response_kind: 'hash' }).body) end result else filters = { ids: ids_group.join(',') } get_request('/visits/items', filters, { api_response_kind: 'hash' }).body[item_ids] end end |
#get_user_items_see_phone_clicked_quantities_tw(item_ids, args) ⇒ Object
53 54 55 56 |
# File 'lib/mercadolibre/core/metrics.rb', line 53 def get_user_items_see_phone_clicked_quantities_tw(item_ids, args) item_ids_desc = (item_ids.is_a?(Array) ? item_ids.join(',') : item_ids) get_request("/items/contacts/phone_views/time_window", args.merge(ids: item_ids_desc)).body end |
#get_user_question_quantities(user_id, args = {}) ⇒ Object
12 13 14 |
# File 'lib/mercadolibre/core/metrics.rb', line 12 def get_user_question_quantities(user_id, args={}) get_request("/users/#{user_id}/contacts/questions", args).body end |
#get_user_question_quantities_tw(user_id, args = {}) ⇒ Object
16 17 18 |
# File 'lib/mercadolibre/core/metrics.rb', line 16 def get_user_question_quantities_tw(user_id, args={}) get_request("/users/#{user_id}/contacts/questions/time_window", args).body end |
#get_user_see_phone_clicked_quantities(user_id, args = {}) ⇒ Object
20 21 22 |
# File 'lib/mercadolibre/core/metrics.rb', line 20 def get_user_see_phone_clicked_quantities(user_id, args={}) get_request("/users/#{user_id}/contacts/phone_views", args).body end |
#get_user_see_phone_clicked_quantities_tw(user_id, args = {}) ⇒ Object
24 25 26 |
# File 'lib/mercadolibre/core/metrics.rb', line 24 def get_user_see_phone_clicked_quantities_tw(user_id, args={}) get_request("/users/#{user_id}/contacts/phone_views/time_window", args).body end |
#get_user_visits(user_id, args = {}) ⇒ Object
4 5 6 |
# File 'lib/mercadolibre/core/metrics.rb', line 4 def get_user_visits(user_id, args={}) get_request("/users/#{user_id}/items_visits", args).body end |
#get_user_visits_tw(user_id, args = {}) ⇒ Object
8 9 10 |
# File 'lib/mercadolibre/core/metrics.rb', line 8 def get_user_visits_tw(user_id, args={}) get_request("/users/#{user_id}/items_visits/time_window", args).body end |