trumail 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -13
- data/lib/trumail/lookup.rb +22 -2
- data/lib/trumail/version.rb +1 -1
- data/trumail.gemspec +2 -0
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc7bb7a2b7c657af3c267c2988b8846a73f4f4304727322f6c00a259861f88eb
|
4
|
+
data.tar.gz: e1215fdc190b1fc949ee59a4089d1d92a051e86ee946d0486907c38090175d3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84d1c76e6601452c0ec763a9768ed64caec5361e04f950db2d72d6a20e3ca24f684234290eaa06245c8f98f358e28d20a2800769d31ba6ef0a88c600b77fa3c0
|
7
|
+
data.tar.gz: d789e279171104499f720bf09ad6463c9fdd3865516cc8cb07c96dcd85af607305c986a22c6d44ec49b332dadd359011f7ed6560d1dfe7a5b4b14739cd947658
|
data/README.md
CHANGED
@@ -31,26 +31,30 @@ lookup = Trumail::Lookup.new('test@email.com').verify
|
|
31
31
|
lookup = Trumail::Lookup.verify('test@email.com')
|
32
32
|
|
33
33
|
# Custom Host
|
34
|
-
lookup = Trumail::Lookup.verify('test@email.com', host: 'https://verifier.com',
|
35
|
-
format: :xml)
|
34
|
+
lookup = Trumail::Lookup.verify('test@email.com', host: 'https://verifier.com', format: :xml)
|
36
35
|
```
|
37
36
|
|
38
37
|
### Lookup Methods
|
39
38
|
|
40
39
|
```ruby
|
41
|
-
lookup.url
|
42
|
-
lookup.hash
|
40
|
+
lookup.url => 'https://api.trumail.io/v2/lookup/json?email=test@email.com'
|
41
|
+
lookup.hash => { 'address' => 'test@email.com', 'catchAll' => true, ... }
|
43
42
|
|
44
43
|
# Data Methods
|
45
|
-
lookup.address
|
46
|
-
lookup.username
|
47
|
-
lookup.domain
|
48
|
-
lookup.
|
49
|
-
lookup.
|
50
|
-
lookup.
|
51
|
-
lookup.
|
52
|
-
lookup.
|
53
|
-
lookup.
|
44
|
+
lookup.address => 'test@email.com'
|
45
|
+
lookup.username => 'test'
|
46
|
+
lookup.domain => 'email.com'
|
47
|
+
lookup.md5_hash => '0065537cb732045561c0d23e859710f4'
|
48
|
+
lookup.suggestion => ''
|
49
|
+
lookup.catch_all? => true
|
50
|
+
lookup.deliverable? => false
|
51
|
+
lookup.disposable? => true
|
52
|
+
lookup.free? => true
|
53
|
+
lookup.full_inbox? => false
|
54
|
+
lookup.gravatar? => true
|
55
|
+
lookup.host_exists? => false
|
56
|
+
lookup.role? => false
|
57
|
+
lookup.valid_format? => true
|
54
58
|
```
|
55
59
|
|
56
60
|
## Contributing
|
data/lib/trumail/lookup.rb
CHANGED
@@ -6,7 +6,7 @@ require 'user_agent_db'
|
|
6
6
|
module Trumail
|
7
7
|
class Lookup
|
8
8
|
|
9
|
-
DEFAULT_HOST ||= 'https://trumail.io'
|
9
|
+
DEFAULT_HOST ||= 'https://api.trumail.io'
|
10
10
|
DEFAULT_FORMAT ||= :json
|
11
11
|
|
12
12
|
attr_reader :email, :hash, :host, :format, :response
|
@@ -35,7 +35,7 @@ module Trumail
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def url
|
38
|
-
"#{@host}/#{@format}
|
38
|
+
"#{@host}/v2/lookups/#{@format}?email=#{@email}"
|
39
39
|
end
|
40
40
|
|
41
41
|
def address
|
@@ -58,6 +58,10 @@ module Trumail
|
|
58
58
|
@hash['domain']
|
59
59
|
end
|
60
60
|
|
61
|
+
def free?
|
62
|
+
@hash['free']
|
63
|
+
end
|
64
|
+
|
61
65
|
def full_inbox?
|
62
66
|
@hash['fullInbox']
|
63
67
|
end
|
@@ -70,10 +74,26 @@ module Trumail
|
|
70
74
|
@hash['hostExists']
|
71
75
|
end
|
72
76
|
|
77
|
+
def md5_hash
|
78
|
+
@hash['md5Hash']
|
79
|
+
end
|
80
|
+
|
81
|
+
def role?
|
82
|
+
@hash['role']
|
83
|
+
end
|
84
|
+
|
85
|
+
def suggestion
|
86
|
+
@hash['suggestion']
|
87
|
+
end
|
88
|
+
|
73
89
|
def username
|
74
90
|
@hash['username']
|
75
91
|
end
|
76
92
|
|
93
|
+
def valid_format?
|
94
|
+
@hash['validFormat']
|
95
|
+
end
|
96
|
+
|
77
97
|
private
|
78
98
|
|
79
99
|
def parse_by_format
|
data/lib/trumail/version.rb
CHANGED
data/trumail.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trumail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ox
|
@@ -136,6 +136,34 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: vcr
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: webmock
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
139
167
|
description: Trumail Ruby SDK for interacting with the Trumail API.
|
140
168
|
email:
|
141
169
|
- j.gomez@drexed.com
|
@@ -184,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
212
|
version: '0'
|
185
213
|
requirements: []
|
186
214
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.7.
|
215
|
+
rubygems_version: 2.7.7
|
188
216
|
signing_key:
|
189
217
|
specification_version: 4
|
190
218
|
summary: Trumail Ruby SDK.
|