smtp_lw 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smtp_lw.rb +3 -0
- data/lib/smtp_lw/client.rb +11 -3
- data/lib/smtp_lw/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e7a01d7bdb2f90cbdf4be8e216484b73ddf09aa
|
4
|
+
data.tar.gz: 5638a3bc35a3e9eaefad7ca595a5a09d7970a1f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff3a5aa32377e43ef7896d26c6d50ffc35a6e3709ec5f6d029667de2dda7b341123976b51bd15676193bb739a6348b1a4c0fbb3d3b84e9826e1dc8b769b79541
|
7
|
+
data.tar.gz: 0b21195fe892b625fd95d5d54a763a24bba3af8bc2aba3f31fb1e38a34b2d877f53d2c82f6a642f8524e9400c4c54ca3a2aaba4793b706c78315297f6442d7bb
|
data/lib/smtp_lw.rb
CHANGED
data/lib/smtp_lw/client.rb
CHANGED
@@ -52,21 +52,29 @@ module SmtpLw
|
|
52
52
|
|
53
53
|
def paginate(options)
|
54
54
|
page = options[:page] || 1
|
55
|
-
per = options[:per] || SmtpLw.per_page
|
55
|
+
per = options[:per] || (@per_page || SmtpLw.per_page)
|
56
56
|
options.merge(page: page, per: per)
|
57
57
|
end
|
58
58
|
|
59
59
|
def connection
|
60
|
-
conn = Faraday.new(url: SmtpLw.api_endpoint, ssl: {verify: false}) do |c|
|
60
|
+
conn = Faraday.new(url: (@api_endpoint || SmtpLw.api_endpoint), ssl: {verify: false}) do |c|
|
61
61
|
c.request :json
|
62
62
|
c.response :json
|
63
63
|
c.adapter Faraday.default_adapter
|
64
64
|
|
65
65
|
end
|
66
66
|
conn.headers['User-Agent'] = "SMTP LW Ruby API Client v#{VERSION}"
|
67
|
-
conn.headers['x-auth-token'] = SmtpLw.api_token
|
67
|
+
conn.headers['x-auth-token'] = @api_token || SmtpLw.api_token
|
68
68
|
conn
|
69
69
|
end
|
70
70
|
|
71
|
+
def per_page
|
72
|
+
@per_page || SmtpLw.per_page
|
73
|
+
end
|
74
|
+
|
75
|
+
def api_endpoint
|
76
|
+
@api_endpoint || SmtpLw.api_endpoint
|
77
|
+
end
|
78
|
+
|
71
79
|
end
|
72
80
|
end
|
data/lib/smtp_lw/version.rb
CHANGED