fanforce 0.3.11 → 0.3.12

Sign up to get free protection for your applications and to get access to all the features.
data/lib/fanforce/main.rb CHANGED
@@ -4,20 +4,22 @@ require 'rest-client'
4
4
 
5
5
  class Fanforce
6
6
  include Fanforce::Utils
7
- attr_reader :params
8
7
  ########################################################################
9
8
  def initialize(arg={})
10
9
  if arg.is_a?(Hash)
11
10
  add_params(arg)
12
- auth(@params) if @params.length > 0
11
+ auth(params) if params.length > 0
13
12
  elsif arg.is_a?(String)
14
13
  auth(arg)
15
14
  end
16
15
  end
17
16
 
18
- def add_params(params)
17
+ def params
19
18
  @params ||= {}
20
- @params.merge!(collect_known_params params)
19
+ end
20
+
21
+ def add_params(params)
22
+ params.merge!(collect_known_params params)
21
23
  end
22
24
 
23
25
  def get(path, params={})
@@ -95,7 +97,7 @@ class Fanforce
95
97
  return @auth_hash if is_blank?(auth_data)
96
98
  auth_data = auth_data.is_a?(Hash) ? auth_data.symbolize_keys : {api_key: auth_data.to_s}
97
99
  @auth_hash.merge! remove_nil_values(api_key: auth_data[:api_key], fanforce_id: auth_data[:fanforce_id], fanforce_slug: auth_data[:fanforce_slug], app_id: auth_data[:app_id], module_id: auth_data[:module_id], behavior_id: auth_data[:behavior_id], widget_id: auth_data[:widget_id])
98
- @params.merge!(@auth_hash)
100
+ params.merge!(@auth_hash)
99
101
  valid_auth?
100
102
  end
101
103
 
@@ -1,3 +1,3 @@
1
1
  class Fanforce
2
- VERSION = "0.3.11"
2
+ VERSION = "0.3.12"
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.3.11
4
+ version: 0.3.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: