Class: JIRA::Attachment

Inherits:
NamedEntity show all
Defined in:
lib/jiraSOAP/entities/attachment.rb

Overview

Only contains the metadata for an attachment. The URI for an attachment appears to be of the form "JIRAService.endpoint_url/secure/attachment/DynamicEntity#id/#file_name".

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from NamedEntity

#name

Methods inherited from DynamicEntity

#id

Methods inherited from Entity

add_attribute, inherited, #initialize_with_xml, new_with_xml

Instance Attribute Details

#contentString

Note:

This method does not allow you to read the content of an existing attachment on the issue; only the metadata for the attachment may be read at this time.

Content to be used for adding attachments, using RemoteAPI#add_attachments_to_issue_with_key. Do not base64 encode the data yourself, it will be done for you when the attachment is uploaded.

However, attachment data coming from the server will come down in base64 encoded format...

Returns:

  • (String)


32
33
34
# File 'lib/jiraSOAP/entities/attachment.rb', line 32

def content
  @content
end

Instance Method Details

#attachmentObject

Fetch the attachment from the server.

Raises:

  • (NotImplementedError)


50
51
52
# File 'lib/jiraSOAP/entities/attachment.rb', line 50

def attachment
  raise NotImplementedError, 'Please implement me. :('
end

#authorString

Returns:

  • (String)


8
# File 'lib/jiraSOAP/entities/attachment.rb', line 8

add_attribute :author, 'author', :content

#create_timeTime

Returns:

  • (Time)


46
# File 'lib/jiraSOAP/entities/attachment.rb', line 46

add_attribute :create_time, 'created', :to_iso_date

#file_nameString Also known as: filename

Returns:

  • (String)


11
# File 'lib/jiraSOAP/entities/attachment.rb', line 11

add_attribute :file_name, 'filename', :content

#file_sizeNumber

Measured in bytes

Returns:

  • (Number)


43
# File 'lib/jiraSOAP/entities/attachment.rb', line 43

add_attribute :file_size, 'filesize', :to_i

#mime_typeString Also known as: content_type

Returns:

  • (String)


35
# File 'lib/jiraSOAP/entities/attachment.rb', line 35

add_attribute :mime_type, 'mimetype', :content