gettestmail 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 694141f1056032b4e20b962abc3e4828e7cae8e9f863015a1f825edf643eb460
4
- data.tar.gz: b32e03e36edad77422f9209a389f4cb38002f2a51b3cffbc834382789a3bde11
3
+ metadata.gz: a4c995c040bc6afe8feff85a2ffbe83664c1e156b4ceffa401e27409f292ff39
4
+ data.tar.gz: 04dd8d859497d7c323a00b2f3e24cf228ffa01391104a9561db7a369c57c41c2
5
5
  SHA512:
6
- metadata.gz: 06f520cbb20a02f459fc7eb9ccdefa27c75182b2488e41cbc68be2cf15573831a5013195f1f583b657ca91310034ba10d8bc64aa657309cd769fb4bd92fba1ca
7
- data.tar.gz: cc5ceb0bfee07c9fd4ebd3fa53aaa70f0fc67f9ba1a5115f33a3200b98216ad020a4003abfc9c97c3ef382be69867483638b42ae6e9665d671d6926e5085da38
6
+ metadata.gz: 0f5b6feb878a02573d9f9fb3d807ef050bc4ca138e6358130dfe972fcf11aaeaf8bf58d1dd8cdaa0707b165c9afb9c18a00124ced22898259a1fadb9f2827150
7
+ data.tar.gz: dabd6f5ffdc8cee4127b687838135c19fe8827cef871cd1466836a77c893658f78316e3624d838792c60ee5cfbcd7b0963adb555e9cc53fa7862f2d8123386f7
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ruby-sdk
2
2
 
3
- A Ruby client for interacting with the GetTestMail API, which allows you to create disposable email addresses for testing purposes.
3
+ A Ruby client for interacting with the GetTestMail API, which provides a simple way to create temporary email addresses and receive messages sent to them.
4
4
 
5
5
  ## Installation
6
6
 
@@ -23,8 +23,8 @@ $ gem install gettestmail
23
23
 
24
24
  ## Usage
25
25
 
26
- Creating a New Client
27
- To create a new GetTestMail API client, you need to instantiate the GetTestMailClient class with your API key:
26
+ ### Creating a New Client
27
+ To create a new GetTestMail API client, you need to instantiate the GetTestMailClient class with your API key. To get an API key, sign up for a free [account](https://gettestmail.com).
28
28
 
29
29
  ```ruby
30
30
  require 'gettestmailclient'
@@ -33,17 +33,20 @@ api_key = 'your-api-key'
33
33
  client = GetTestMailClient.new(api_key)
34
34
  ```
35
35
 
36
- Creating a New GetTestMail Instance
36
+ ### Creating a New GetTestMail Instance
37
37
  To create a new GetTestMail instance, call the create_new method on the client:
38
38
 
39
39
  ```ruby
40
40
  get_test_mail = client.create_new
41
41
  puts "Email address: #{get_test_mail.email_address}"
42
42
  puts "Expires at: #{get_test_mail.expires_at}"
43
- # Waiting for a Message
44
- # To wait for a message, call the wait_for_message method with the email address:
43
+ ```
44
+
45
+ ### Waiting for a Message
46
+ To wait for a message, call the wait_for_message method with the email address:
45
47
 
46
- message = client.wait_for_message(get_test_mail.email_address)
48
+ ```ruby
49
+ message = client.wait_for_message(get_test_mail.id)
47
50
  puts "Message from: #{message.from}"
48
51
  puts "Message subject: #{message.subject}"
49
52
  puts "Message: #{message}"
@@ -55,34 +58,31 @@ puts "Message: #{message}"
55
58
 
56
59
  The GetTestMail model represents a disposable email address. It has the following attributes:
57
60
 
58
- ```
59
- email_address: The disposable email address.
60
- expires_at: The expiration time of the email address.
61
- ```
61
+ * id - The id of the email address
62
+ * emailAddress - The email address
63
+ * expiresAt - The time at which the email address will expire
64
+ * message - The message received by the email address
62
65
 
63
66
  ### Message
64
67
 
65
- The Message model represents an email message. It has the following attributes:
68
+ The Message received by the email address. It has the following attributes:
66
69
 
67
- ```
68
- id: The unique identifier of the message.
69
- from: The sender's email address.
70
- to: The recipient's email address.
71
- subject: The subject of the email.
72
- text: The plain text version of the email.
73
- html: The HTML version of the email.
74
- attachments: An array of Attachment objects.
75
- ```
70
+ * id - The id of the message
71
+ * from - The sender of the message
72
+ * to - The recipient of the message
73
+ * subject - The subject of the message
74
+ * text - Text representation of the message
75
+ * html - HTML representation of the message
76
+ * attachments - List of attachments
76
77
 
77
78
  ### Attachment
78
79
 
79
- The Attachment model represents an email attachment. It has the following attributes:
80
+ The Attachment received by the email address. It has the following attributes:
81
+
82
+ * filename - The filename of the attachment
83
+ * mimeType - The mime type of the attachment
84
+ * content - The content of the attachment
80
85
 
81
- ```
82
- filename: The name of the attached file.
83
- mime_type: The MIME type of the attached file.
84
- content: The content of the attached file.
85
- ```
86
86
 
87
87
  ## Error Handling
88
88
 
@@ -1,11 +1,11 @@
1
1
  class Attachment
2
- attr_accessor :filename, :mime_type, :content
2
+ attr_accessor :filename, :mimeType, :content
3
3
 
4
4
  def initialize(json)
5
5
  json.each { |key, value| instance_variable_set("@#{key}", value) }
6
6
  end
7
7
 
8
8
  def to_s
9
- "Name: #{filename}, Mime-Type: #{mime_type}"
9
+ "Name: #{filename}, Mime-Type: #{mimeType}"
10
10
  end
11
11
  end
@@ -2,7 +2,7 @@ require_relative 'base_dto'
2
2
  require_relative 'message'
3
3
 
4
4
  class GetTestMail < BaseDTO
5
- attr_accessor :emailAddress, :expiresAt, :message
5
+ attr_accessor :id, :emailAddress, :expiresAt, :message
6
6
 
7
7
  def initialize(json)
8
8
  super(json)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettestmail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bobby Donchev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-14 00:00:00.000000000 Z
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty