Class: Mailscope::Message::Attachment

Inherits:
Struct
  • Object
show all
Defined in:
lib/mailscope/message.rb

Overview

rubocop:disable Lint/StructNewOverride -- size mirrors the metadata key and these structs are plain value objects, never enumerated.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cidObject

Returns the value of attribute cid

Returns:

  • (Object)

    the current value of cid



17
18
19
# File 'lib/mailscope/message.rb', line 17

def cid
  @cid
end

#content_typeObject

Returns the value of attribute content_type

Returns:

  • (Object)

    the current value of content_type



17
18
19
# File 'lib/mailscope/message.rb', line 17

def content_type
  @content_type
end

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



17
18
19
# File 'lib/mailscope/message.rb', line 17

def filename
  @filename
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



17
18
19
# File 'lib/mailscope/message.rb', line 17

def id
  @id
end

#inlineObject

Returns the value of attribute inline

Returns:

  • (Object)

    the current value of inline



17
18
19
# File 'lib/mailscope/message.rb', line 17

def inline
  @inline
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



17
18
19
# File 'lib/mailscope/message.rb', line 17

def size
  @size
end

Instance Method Details

#image?Boolean

Returns:

  • (Boolean)


20
# File 'lib/mailscope/message.rb', line 20

def image? = content_type.to_s.start_with?('image/')

#inline?Boolean

Returns:

  • (Boolean)


18
# File 'lib/mailscope/message.rb', line 18

def inline? = !!inline

#to_hObject



22
# File 'lib/mailscope/message.rb', line 22

def to_h = { id:, filename:, content_type:, size:, cid:, inline: }