Class: TempmailSdk::EmailInfo
- Inherits:
-
Object
- Object
- TempmailSdk::EmailInfo
- Defined in:
- lib/tempmail_sdk/types.rb
Overview
创建临时邮箱后返回的邮箱信息 Token 等认证信息由 SDK 内部维护,不对外暴露(token 通过私有读取器访问)
Instance Attribute Summary collapse
-
#channel ⇒ String
创建该邮箱所使用的渠道.
-
#created_at ⇒ Object?
邮箱创建时间.
-
#email ⇒ String
临时邮箱地址.
-
#expires_at ⇒ Integer?
邮箱过期时间(毫秒时间戳).
Instance Method Summary collapse
-
#initialize(channel:, email:, token: nil, expires_at: nil, created_at: nil) ⇒ EmailInfo
constructor
A new instance of EmailInfo.
- #to_s ⇒ Object (also: #inspect)
-
#token ⇒ String?
SDK 内部使用的令牌读取器(对外语义上不暴露,仅内部 dispatch 使用).
Constructor Details
#initialize(channel:, email:, token: nil, expires_at: nil, created_at: nil) ⇒ EmailInfo
Returns a new instance of EmailInfo.
21 22 23 24 25 26 27 |
# File 'lib/tempmail_sdk/types.rb', line 21 def initialize(channel:, email:, token: nil, expires_at: nil, created_at: nil) @channel = channel @email = email @token = token @expires_at = expires_at @created_at = created_at end |
Instance Attribute Details
#channel ⇒ String
Returns 创建该邮箱所使用的渠道.
8 9 10 |
# File 'lib/tempmail_sdk/types.rb', line 8 def channel @channel end |
#created_at ⇒ Object?
Returns 邮箱创建时间.
14 15 16 |
# File 'lib/tempmail_sdk/types.rb', line 14 def created_at @created_at end |
#email ⇒ String
Returns 临时邮箱地址.
10 11 12 |
# File 'lib/tempmail_sdk/types.rb', line 10 def email @email end |
#expires_at ⇒ Integer?
Returns 邮箱过期时间(毫秒时间戳).
12 13 14 |
# File 'lib/tempmail_sdk/types.rb', line 12 def expires_at @expires_at end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
39 40 41 42 |
# File 'lib/tempmail_sdk/types.rb', line 39 def to_s "#<EmailInfo channel=#{@channel.inspect} email=#{@email.inspect} " \ "expires_at=#{@expires_at.inspect} created_at=#{@created_at.inspect}>" end |
#token ⇒ String?
SDK 内部使用的令牌读取器(对外语义上不暴露,仅内部 dispatch 使用)
35 36 37 |
# File 'lib/tempmail_sdk/types.rb', line 35 def token @token end |