mailosaur 6.0.1 → 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aac97d5c2ae2635b48b73c675fa343d12e1048360d61fe3f89306bd934fe6c9d
4
- data.tar.gz: a75707fa35b710fa3821104869d703e719795bda7a6fe4ed78cb72af6568f171
3
+ metadata.gz: a5dc306bc65feea8659cd8a674a55de4540d464ebee99126a66517d6462eb1ea
4
+ data.tar.gz: 693c6095c60f15d894d1ebfa757459902807b428418eef6ee3bbbe914833dd58
5
5
  SHA512:
6
- metadata.gz: 71d83efaa73bfa3ea131aa1538381ffe252c7c16cd6ddd3816926b1ade5fb3346c985c9f62964ddd9c87308e5d1beed3602049f6e968bda7cc2b6bc63fd31f63
7
- data.tar.gz: 9c44bbc6f312cac44669240d04c034e3275719592c3fdd239e03587949fbd2afc5895870dcffde396ca909ca56523661ba4e9102109a159579475745638a4d84
6
+ metadata.gz: dc8b2a6c20ba48a7b397085b5a7c1298a7651271677d9fb794671cb88037f653bd18e73749404f00212ba414f12a08a80e2374183acedf96f80562c42817d7f1
7
+ data.tar.gz: '08ed30549191fb9563f63b24d07e1063912e42578811d8c8dee64e7c2e8f01998f7deed3d18f2ddcc0fe68a440712769f919d840a093a9b3329e2adcc8985a19'
@@ -1,3 +1,3 @@
1
1
  module Mailosaur
2
- VERSION = '6.0.1'
2
+ VERSION = '6.0.2'
3
3
  end
@@ -38,37 +38,45 @@ module Mailosaur
38
38
  end
39
39
 
40
40
  class MailosaurClient
41
+ #
42
+ # Creates initializes a new instance of the MailosaurClient class.
43
+ # @param api_key [String] your Mailosaur API key.
44
+ # @param base_url [String] the base URI of the service.
45
+ #
46
+ def initialize(api_key, base_url = 'https://mailosaur.com/')
47
+ @api_key = api_key
48
+ @base_url = base_url
49
+ end
50
+
41
51
  # @return [Analysis] analysis
42
- attr_reader :analysis
52
+ def analysis
53
+ @analysis ||= Analysis.new(connection)
54
+ end
43
55
 
44
56
  # @return [Files] files
45
- attr_reader :files
57
+ def files
58
+ @files ||= Files.new(connection)
59
+ end
46
60
 
47
61
  # @return [Messages] messages
48
- attr_reader :messages
62
+ def messages
63
+ @messages ||= Messages.new(connection)
64
+ end
49
65
 
50
66
  # @return [Servers] servers
51
- attr_reader :servers
67
+ def servers
68
+ @servers ||= Servers.new(connection)
69
+ end
52
70
 
53
- #
54
- # Creates initializes a new instance of the MailosaurClient class.
55
- # @param api_key [String] your Mailosaur API key.
56
- # @param base_url [String] the base URI of the service.
57
- #
58
- def initialize(api_key, base_url)
59
- conn = Faraday.new(base_url || 'https://mailosaur.com/', {
71
+ private
72
+
73
+ def connection
74
+ Faraday.new(@base_url, {
60
75
  headers: {
61
76
  content_type: 'application/json; charset=utf-8',
62
77
  user_agent: 'mailosaur-ruby/' + Mailosaur::VERSION
63
78
  }
64
- })
65
-
66
- conn.basic_auth(api_key, '')
67
-
68
- @analysis = Analysis.new(conn)
69
- @files = Files.new(conn)
70
- @messages = Messages.new(conn)
71
- @servers = Servers.new(conn)
79
+ }).tap { |conn| conn.basic_auth(@api_key, '') }
72
80
  end
73
81
  end
74
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailosaur
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mailosaur Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-18 00:00:00.000000000 Z
11
+ date: 2019-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday