class B2bCenterApi::WebService::Types::AttachmentName

Файл для отправки

Attributes

filename[R]

@return [String] Имя файла

md5[R]

@return [String] MD5 от содержимого файла

Public Class Methods

from_array(files_array) click to toggle source

Подготовка массива AttachmentName для отправки @param files_array [Array] Массив файлов @return [Array] Массив хешей для отправки по SOAP

# File lib/b2b_center_api/web_service/types/attachment_name.rb, line 24
def self.from_array(files_array)
  files_array.map do |file|
    { file: new(file).to_h }
  end
end
new(file_path) click to toggle source
# File lib/b2b_center_api/web_service/types/attachment_name.rb, line 15
def initialize(file_path)
  file = File.new(file_path)
  @filename = File.basename(file_path)
  @md5 = Digest::MD5.hexdigest(file.read)
end