Class: B2bCenterApi::RemoteAuction
- Inherits:
-
Object
- Object
- B2bCenterApi::RemoteAuction
- Defined in:
- lib/b2b_center_api/remote_auction.rb
Overview
Методы класса RemoteAuction
Instance Method Summary collapse
-
#create(auction_data) ⇒ Integer
Создать новый аукцион.
-
#get_data(auction_id) ⇒ WebService::Types::AuctionData
Получить данные аукциона.
-
#get_group_ids(auction_id) ⇒ WebService::Types::ArrayOfIds[]
Получить список идентификаторов лотов многолотовой процедуры.
-
#get_offer(auction_id, firm_id, offer_num) ⇒ WebService::Types::AuctionOffer
Получить предложение участника Метод возвращает информацию о предложении (альтернативном предложении) участника: последней ставке, имя файла с описанием предложения, информацию о том признан ли участник победителем.
-
#get_participants(auction_id) ⇒ WebService::Types::AuctionParticipant[]
Получить список участников.
-
#get_participants_protocol(auction_id, haggling_num = 0) ⇒ AuctionParticipantsProtocol
Поулчить данные о протоколе вскрытия конвертов с предложениями.
-
#initialize(client) ⇒ RemoteAuction
constructor
A new instance of RemoteAuction.
-
#upload_doc(auction_id, file, type = 'docs', append_mode = 1) ⇒ String
Загрузить документацию к аукциону/объявлению.
-
#upload_doc_from_url(auction_id, url, type = 'docs', append_mode = 1) ⇒ String
Загрузить документацию к аукциону/объявлению через url.
-
#upload_docs(auction_id, files, type = 'docs', append_mode = 1) ⇒ String
Загрузить документацию из нескольких файлов к аукциону/объявлению !Загружает не более двух файлов за раз, иначе ошибка!.
Constructor Details
#initialize(client) ⇒ RemoteAuction
Returns a new instance of RemoteAuction.
6 7 8 9 |
# File 'lib/b2b_center_api/remote_auction.rb', line 6 def initialize(client) @client = client @client_web = WebService::RemoteAuction.new(client) end |
Instance Method Details
#create(auction_data) ⇒ Integer
Создать новый аукцион
79 80 81 82 83 |
# File 'lib/b2b_center_api/remote_auction.rb', line 79 def create(auction_data) auction_data = auction_data.to_h unless auction_data.is_a? Hash response = @client_web.command :create, data: auction_data response.result[:value] end |
#get_data(auction_id) ⇒ WebService::Types::AuctionData
Получить данные аукциона
88 89 90 91 |
# File 'lib/b2b_center_api/remote_auction.rb', line 88 def get_data(auction_id) response = @client_web.command :get_data, auction_id: auction_id WebService::Types::AuctionData.from_response(response, @client, auction_id) end |
#get_group_ids(auction_id) ⇒ WebService::Types::ArrayOfIds[]
Получить список идентификаторов лотов многолотовой процедуры
104 105 106 107 |
# File 'lib/b2b_center_api/remote_auction.rb', line 104 def get_group_ids(auction_id) response = @client_web.command :get_group_ids, auction_id: auction_id WebService::Types::ArrayOfIds.from_response(response) end |
#get_offer(auction_id, firm_id, offer_num) ⇒ WebService::Types::AuctionOffer
Получить предложение участника Метод возвращает информацию о предложении (альтернативном предложении) участника: последней ставке, имя файла с описанием предложения, информацию о том признан ли участник победителем. Возвращаемый методом файл доступен для скачивания из корневой FTP-папки организации.
117 118 119 120 |
# File 'lib/b2b_center_api/remote_auction.rb', line 117 def get_offer(auction_id, firm_id, offer_num) response = @client_web.command :get_offer, auction_id: auction_id, firm_id: firm_id, offer_num: offer_num WebService::Types::AuctionOffer.from_response(response, @client, auction_id, firm_id, offer_num) end |
#get_participants(auction_id) ⇒ WebService::Types::AuctionParticipant[]
Получить список участников
96 97 98 99 |
# File 'lib/b2b_center_api/remote_auction.rb', line 96 def get_participants(auction_id) response = @client_web.command :get_participants, auction_id: auction_id WebService::Types::AuctionParticipant.from_response(response, @client, auction_id) end |
#get_participants_protocol(auction_id, haggling_num = 0) ⇒ AuctionParticipantsProtocol
Поулчить данные о протоколе вскрытия конвертов с предложениями
18 19 20 21 |
# File 'lib/b2b_center_api/remote_auction.rb', line 18 def get_participants_protocol(auction_id, haggling_num = 0) response = @client_web.command :get_participants_protocol, auction_id: auction_id, haggling_num: haggling_num WebService::Types::AuctionParticipantsProtocol.from_response(response) end |
#upload_doc(auction_id, file, type = 'docs', append_mode = 1) ⇒ String
Загрузить документацию к аукциону/объявлению
52 53 54 55 |
# File 'lib/b2b_center_api/remote_auction.rb', line 52 def upload_doc(auction_id, file, type = 'docs', append_mode = 1) response = @client_web. :upload_doc, [file], auction_id: auction_id, type: type, append_mode: append_mode, attachment_name: WebService::Types::AttachmentName.new(file).to_h response.status[:error_code] end |
#upload_doc_from_url(auction_id, url, type = 'docs', append_mode = 1) ⇒ String
Загрузить документацию к аукциону/объявлению через url
35 36 37 38 |
# File 'lib/b2b_center_api/remote_auction.rb', line 35 def upload_doc_from_url(auction_id, url, type = 'docs', append_mode = 1) response = @client_web.command :upload_doc, auction_id: auction_id, type: type, append_mode: append_mode, url: url response.status[:error_code] end |
#upload_docs(auction_id, files, type = 'docs', append_mode = 1) ⇒ String
Загрузить документацию из нескольких файлов к аукциону/объявлению !Загружает не более двух файлов за раз, иначе ошибка!
70 71 72 73 74 |
# File 'lib/b2b_center_api/remote_auction.rb', line 70 def upload_docs(auction_id, files, type = 'docs', append_mode = 1) files = [files] unless files.is_a? Array response = @client_web. :upload_docs, files, auction_id: auction_id, type: type, append_mode: append_mode, attachment_names: WebService::Types::AttachmentName.from_array(files) response.status[:error_code] end |