fanforce 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/fanforce/main.rb CHANGED
@@ -63,17 +63,17 @@ class Fanforce
63
63
  response
64
64
  end
65
65
 
66
- def auth(key_or_hash=nil)
67
- if present?(key_or_hash)
68
- key_or_hash.is_a?(Hash) ? auth_hash = key_or_hash.symbolize_keys : auth_hash = {key: key_or_hash}
69
- @auth_hash = {key: key} if present?(auth_hash[:key])
66
+ def auth(auth_hash=nil)
67
+ if present?(auth_hash)
68
+ auth_hash = auth_hash.is_a?(Hash) ? auth_hash.symbolize_keys : {api_key: auth_hash}
69
+ @auth_hash[:api_key] if present?(auth_hash[:api_key])
70
70
  @auth_hash[:fanforce_id] if present?(auth_hash[:fanforce_id])
71
71
  end
72
72
  @auth_hash
73
73
  end
74
74
 
75
75
  def valid_auth?
76
- present?(@auth_hash) and present?(@auth_hash[:key])
76
+ present?(@auth_hash) and present?(@auth_hash[:api_key])
77
77
  end
78
78
 
79
79
  def apply_auth(params)
@@ -22,7 +22,7 @@ module Fanforce::Utils
22
22
  return false if !params.is_a?(Hash)
23
23
  return false if blank?(params[:fanforce_id])
24
24
  return false if blank?(params[:app_id]) and blank?(params[:behavior_id]) and blank?(params[:module_id]) and blank?(params[:widget_id])
25
- return false if blank?(params[:key])
25
+ return false if blank?(params[:api_key])
26
26
  return true
27
27
  end
28
28
 
@@ -30,7 +30,7 @@ module Fanforce::Utils
30
30
  return false if !params.is_a?(Hash)
31
31
  return false if blank?(params[:fanforce_id])
32
32
  return false if blank?(params[:app_id]) and blank?(params[:behavior_id]) and blank?(params[:module_id]) and blank?(params[:widget_id])
33
- return false if blank?(params[:key])
33
+ return false if blank?(params[:api_key])
34
34
  return true
35
35
  end
36
36
 
@@ -48,7 +48,7 @@ module Fanforce::Utils
48
48
  plugin_type = :widget
49
49
  plugin_id = params[:widget_id]
50
50
  end
51
- {:"#{plugin_type}_id" => params["#{plugin_type}_id"], plugin_type: plugin_type, plugin_id: plugin_id, fanforce_id: params[:fanforce_id], key: params[:key]}
51
+ {:"#{plugin_type}_id" => params["#{plugin_type}_id"], plugin_type: plugin_type, plugin_id: plugin_id, fanforce_id: params[:fanforce_id], api_key: params[:api_key]}
52
52
  end
53
53
 
54
54
  def self.parse_url(raw_url)
@@ -1,3 +1,3 @@
1
1
  class Fanforce
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: