fanforce-api 0.23.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -78,12 +78,12 @@ class Fanforce::API
78
78
  post '/bie/identify', req_params
79
79
  end
80
80
 
81
- def track(plugin_id, req_params)
82
- post '/bie/track', req_params.merge(plugin_id: plugin_id)
81
+ def track(com_behavior_id, req_params)
82
+ post '/bie/track', req_params.merge(com_behavior_id: com_behavior_id)
83
83
  end
84
84
 
85
- def recommend(addon_id, unique_key, req_params={})
86
- req_params.update(unique_key: "#{addon_id}:#{unique_key}")
85
+ def recommend(com_behavior_id, unique_key, req_params={})
86
+ req_params.update(unique_key: "#{com_behavior_id}:#{unique_key}")
87
87
  post '/bie/recommend', req_params
88
88
  end
89
89
 
@@ -14,14 +14,14 @@ module Fanforce::API::Utils
14
14
  def valid_fanforce_request?(params=@params)
15
15
  return false if !params.is_a?(Hash)
16
16
  return false if is_blank?(params[:organization_id])
17
- return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_plugin_id]) and is_blank?(params[:plugin_id]) and is_blank?(params[:widget_id])
17
+ return false if is_blank?(params[:app_id])
18
18
  return true
19
19
  end
20
20
 
21
21
  def valid_install_request?(params=@params)
22
22
  return false if !params.is_a?(Hash)
23
23
  return false if is_blank?(params[:organization_id])
24
- return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_plugin_id]) and is_blank?(params[:plugin_id]) and is_blank?(params[:widget_id])
24
+ return false if is_blank?(params[:app_id])
25
25
  return false if is_blank?(params[:api_key])
26
26
  return true
27
27
  end
@@ -29,7 +29,7 @@ module Fanforce::API::Utils
29
29
  def valid_uninstall_request?(params=@params)
30
30
  return false if !params.is_a?(Hash)
31
31
  return false if is_blank?(params[:organization_id])
32
- return false if is_blank?(params[:app_id]) and is_blank?(params[:behavior_plugin_id]) and is_blank?(params[:plugin_id]) and is_blank?(params[:widget_id])
32
+ return false if is_blank?(params[:app_id])
33
33
  return false if is_blank?(params[:api_key])
34
34
  return true
35
35
  end
@@ -40,24 +40,11 @@ module Fanforce::API::Utils
40
40
 
41
41
  def collect_known_params(params)
42
42
  params = symbolize_keys(params)
43
- if is_present?(params[:app_id])
44
- addon_type = :app
45
- addon_id = params[:app_id]
46
- elsif is_present?(params[:behavior_plugin_id])
47
- addon_type = :plugin
48
- addon_id = params[:behavior_plugin_id]
49
- elsif is_present?(params[:plugin_id])
50
- addon_type = :plugin
51
- addon_id = params[:plugin_id]
52
- elsif is_present?(params[:widget_id])
53
- addon_type = :widget
54
- addon_id = params[:widget_id]
55
- end
56
- remove_nil_values(:"#{addon_type}_id" => params[:"#{addon_type}_id"], addon_type: addon_type, addon_id: addon_id, organization_id: params[:organization_id], organization_slug: params[:organization_slug], api_key: params[:api_key], session_id: params[:session_id])
43
+ remove_nil_values(app_id: params[:app_id], organization_id: params[:organization_id], organization_slug: params[:organization_slug], api_key: params[:api_key], session_id: params[:session_id])
57
44
  end
58
45
 
59
46
  def remove_internal_params(params)
60
- params.clone.delete_if { |k,v| [:app_id, :behavior_plugin_id, :plugin_id, :widget_id, :addon_type, :addon_id, :organization_id, :organization_slug, :api_key].include? k }
47
+ params.clone.delete_if { |k,v| [:app_id, :organization_id, :organization_slug, :api_key].include? k }
61
48
  end
62
49
 
63
50
  def remove_sensitive_params(params)
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  class API
3
- VERSION = '0.23.0'
3
+ VERSION = '0.30.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.30.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-16 00:00:00.000000000 Z
12
+ date: 2014-08-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client