Skip to content

Commit 1d504ca

Browse files
committed
Merge pull request #4 from kickboxio/v2
Updating to V2
2 parents e4002c6 + 25726d1 commit 1d504ca

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ client = Kickbox::Client.new('Your_API_Key_Here')
3636
kickbox = client.kickbox()
3737
response = kickbox.verify("test@example.com")
3838
```
39+
#### Options
40+
41+
**timeout** `integer` (optional) - Maximum time, in milliseconds, for the API to complete a verification request. Default: 6000.
42+
43+
```ruby
44+
# Example with options
45+
response = kickbox.verify("test@example.com", { "timeout" => 60000 })
46+
```
3947

4048
### Response information
4149

kickbox.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gem::Specification.new do |gem|
44
gem.name = "kickbox"
5-
gem.version = "1.0.5"
5+
gem.version = "2.0.0"
66
gem.description = "Official kickbox API library client for ruby"
77
gem.summary = "Official kickbox API library client for ruby"
88

lib/kickbox/api/kickbox.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Kickbox
22

33
module Api
44

5-
#
5+
#
66
class Kickbox
77

88
def initialize(client)
@@ -11,13 +11,16 @@ def initialize(client)
1111

1212
# Email Verification
1313
#
14-
# '/verify?email=:email' GET
14+
# '/verify?email=:email&timeout=:timeout' GET
1515
#
1616
# email - Email address to verify
1717
def verify(email, options = {})
18-
body = options.fetch(:query, {})
18+
body = options.fetch("query", {})
19+
timeout = options.fetch("timeout", 6000)
1920

20-
@client.get("/verify?email=#{email}", body, options)
21+
email = CGI::escape(email)
22+
23+
@client.get("/verify?email=#{email}&timeout=#{timeout}", body, options)
2124
end
2225

2326
end

lib/kickbox/http_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def initialize(auth = {}, options = {})
2121

2222
@options = {
2323
:base => "https://api.kickbox.io",
24-
:api_version => "v1",
25-
:user_agent => "alpaca/0.2.1 (https://github.com/pksunkara/alpaca)"
24+
:api_version => "v2",
25+
:user_agent => "kickbox-ruby/2.0.0 (https://github.com/kickboxio/kickbox-ruby)"
2626
}
2727

2828
@options.update(options)

0 commit comments

Comments
 (0)