Class: UU::OS::Attachment::AttachmentCheckIn

Inherits:
REST::DTO
  • Object
show all
Defined in:
uu_os-0.29.16/lib/uu/os/attachment/attachment_check_in.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from REST::DTO

#initialize, #to_json

Constructor Details

This class inherits a constructor from UU::OS::REST::DTO

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class UU::OS::REST::DTO

Instance Attribute Details

- (Object) code

The new code of the attachment. When nil is set, the code is not modified. The code must be unique in a given artifact, otherwise the checkIn command fails.



18
19
20
# File 'uu_os-0.29.16/lib/uu/os/attachment/attachment_check_in.rb', line 18

def code
  @code
end

- (Object) data

Attachment data. When nil is set, the create command fails. Accepted values are String, IO, File or instance of BinaryValue. If use BinaryValue attachment file name can be set by attribute :name of it.



26
27
28
# File 'uu_os-0.29.16/lib/uu/os/attachment/attachment_check_in.rb', line 26

def data
  @data
end

- (Object) description

The new description of the attachment. When nil is set, the description is not modified.



21
22
23
# File 'uu_os-0.29.16/lib/uu/os/attachment/attachment_check_in.rb', line 21

def description
  @description
end

- (Object) name

The new name of the attachment. When nil is set, the name is taken from the attachment file name. The name must be unique in a given artifact, otherwise the checkIn command fails.



14
15
16
# File 'uu_os-0.29.16/lib/uu/os/attachment/attachment_check_in.rb', line 14

def name
  @name
end

- (Object) version_label

The version label of the new attachment version. When nil is set, it is left empty.



29
30
31
# File 'uu_os-0.29.16/lib/uu/os/attachment/attachment_check_in.rb', line 29

def version_label
  @version_label
end

- (Object) version_strategy

Specifies how to work with versions. If set to nil, the OVERWRITE_VERSION strategy will be used (current version will be overwritten, published and the attachment will be unlocked).



33
34
35
# File 'uu_os-0.29.16/lib/uu/os/attachment/attachment_check_in.rb', line 33

def version_strategy
  @version_strategy
end

Instance Method Details

- (Object) to_hash



83
84
85
86
87
88
89
# File 'uu_os-0.29.16/lib/uu/os/attachment/attachment_check_in.rb', line 83

def to_hash 
  hash = super()
  if hash[:versionStrategy].nil?
    hash[:versionStrategy] = UU::OS::Env::VersionStrategy::OVERWRITE_VERSION
  end
  hash
end