hamburglar 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,10 +27,7 @@ module Hamburglar
27
27
  end
28
28
 
29
29
  def initialize(params = {})
30
- defaults = (Hamburglar.config.credentials || {}).select do |key, val|
31
- optional_params.include? key
32
- end
33
- @params = Hash[defaults].merge(params)
30
+ @params = Hash[Hamburglar.config.credentials].merge(params)
34
31
  @errors = {}
35
32
  @response = {}
36
33
  end
@@ -88,16 +85,6 @@ module Hamburglar
88
85
  end
89
86
  end
90
87
 
91
- # Optional parameters that *may* be present in a query
92
- #
93
- # This method should be overridden by classes than inherit from
94
- # Hamburglar::Gateways::Base
95
- #
96
- # Defaults to self.required_params
97
- def optional_params
98
- self.class.required_params
99
- end
100
-
101
88
  private
102
89
 
103
90
  # Formats @params into a query string for an HTTP GET request
@@ -14,37 +14,6 @@ module Hamburglar
14
14
  # Required parameters for a minFraud API call
15
15
  set_required_params :i, :city, :region, :postal, :country, :license_key
16
16
 
17
- # Optional parameters
18
- def optional_params
19
- [
20
- :i,
21
- :city,
22
- :region,
23
- :postal,
24
- :country,
25
- :license_key,
26
- :domain,
27
- :bin,
28
- :binName,
29
- :binPhone,
30
- :custPhone,
31
- :requested_type,
32
- :forwardedIP,
33
- :emailMD5,
34
- :usernameMD5,
35
- :passwordMD5,
36
- :shipAddr,
37
- :shipCity,
38
- :shipRegion,
39
- :shipPostal,
40
- :shipCountry,
41
- :textID,
42
- :sessionID,
43
- :user_agent,
44
- :accept_language
45
- ].freeze
46
- end
47
-
48
17
  def initialize(params = {})
49
18
  params[:i] = params.delete(:ip) if params[:ip]
50
19
  super params
@@ -62,14 +31,9 @@ module Hamburglar
62
31
  # Required parameters for a Telephone Verification API call
63
32
  set_required_params :l, :phone
64
33
 
65
- # Optional parameters
66
- def optional_params
67
- [:l, :phone, :verify_code].freeze
68
- end
69
-
70
34
  def initialize(params = {})
71
- params[:l] = params.delete(:license_key) if params[:license_key]
72
- super params
35
+ super
36
+ self.params[:l] = self.params.delete(:license_key) if self.params[:license_key]
73
37
  end
74
38
  end
75
39
 
@@ -1,3 +1,3 @@
1
1
  module Hamburglar
2
- VERSION = Version = '0.1.2'
2
+ VERSION = Version = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hamburglar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
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: 2012-06-08 00:00:00.000000000 Z
12
+ date: 2013-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -116,15 +116,15 @@ extra_rdoc_files:
116
116
  files:
117
117
  - Rakefile
118
118
  - README.markdown
119
+ - lib/cacert.pem
119
120
  - lib/hamburglar/config.rb
120
- - lib/hamburglar/gateways.rb
121
121
  - lib/hamburglar/errors.rb
122
+ - lib/hamburglar/gateways/base.rb
123
+ - lib/hamburglar/gateways/max_mind.rb
124
+ - lib/hamburglar/gateways.rb
122
125
  - lib/hamburglar/report.rb
123
126
  - lib/hamburglar/version.rb
124
- - lib/hamburglar/gateways/max_mind.rb
125
- - lib/hamburglar/gateways/base.rb
126
127
  - lib/hamburglar.rb
127
- - lib/cacert.pem
128
128
  homepage: https://github.com/site5/hamburglar
129
129
  licenses: []
130
130
  post_install_message:
@@ -138,18 +138,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
138
  - - ! '>='
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
- segments:
142
- - 0
143
- hash: -2045735654354073817
144
141
  required_rubygems_version: !ruby/object:Gem::Requirement
145
142
  none: false
146
143
  requirements:
147
144
  - - ! '>='
148
145
  - !ruby/object:Gem::Version
149
146
  version: '0'
150
- segments:
151
- - 0
152
- hash: -2045735654354073817
153
147
  requirements: []
154
148
  rubyforge_project:
155
149
  rubygems_version: 1.8.23