Class: Tessera::Otrs::Attachment

Inherits:
Base
  • Object
show all
Defined in:
lib/tessera/otrs/attachment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#to_hash

Constructor Details

#initialize(tempfile:) ⇒ Attachment

Returns a new instance of Attachment.



6
7
8
9
10
11
# File 'lib/tessera/otrs/attachment.rb', line 6

def initialize(tempfile:)
  tempfile.rewind
  @Content = Base64.encode64(tempfile.read)
  @ContentType = tempfile.content_type
  @Filename = tempfile.original_filename
end

Instance Attribute Details

#ContentObject

Returns the value of attribute Content.



4
5
6
# File 'lib/tessera/otrs/attachment.rb', line 4

def Content
  @Content
end

#ContentTypeObject

Returns the value of attribute ContentType.



4
5
6
# File 'lib/tessera/otrs/attachment.rb', line 4

def ContentType
  @ContentType
end

#FilenameObject

Returns the value of attribute Filename.



4
5
6
# File 'lib/tessera/otrs/attachment.rb', line 4

def Filename
  @Filename
end