Class: TempmailSdk::EmailAttachment

Inherits:
Object
  • Object
show all
Defined in:
lib/tempmail_sdk/types.rb

Overview

邮件附件信息

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename: "", size: nil, content_type: nil, url: nil) ⇒ EmailAttachment

Returns a new instance of EmailAttachment.



50
51
52
53
54
55
# File 'lib/tempmail_sdk/types.rb', line 50

def initialize(filename: "", size: nil, content_type: nil, url: nil)
  @filename = filename
  @size = size
  @content_type = content_type
  @url = url
end

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



48
49
50
# File 'lib/tempmail_sdk/types.rb', line 48

def content_type
  @content_type
end

#filenameObject

Returns the value of attribute filename.



48
49
50
# File 'lib/tempmail_sdk/types.rb', line 48

def filename
  @filename
end

#sizeObject

Returns the value of attribute size.



48
49
50
# File 'lib/tempmail_sdk/types.rb', line 48

def size
  @size
end

#urlObject

Returns the value of attribute url.



48
49
50
# File 'lib/tempmail_sdk/types.rb', line 48

def url
  @url
end

Instance Method Details

#to_hObject



57
58
59
# File 'lib/tempmail_sdk/types.rb', line 57

def to_h
  { filename: @filename, size: @size, content_type: @content_type, url: @url }
end