Class: B2bCenterApi::WebService::Types::AuctionParticipant
- Defined in:
- lib/b2b_center_api/web_service/types/auction_participant.rb
Overview
Участник аукциона
Constant Summary
Constants inherited from BaseType
Instance Attribute Summary collapse
-
#auction_id ⇒ Integer
Номер аукциона/объявления.
-
#firm_id ⇒ String
ID организации участника, если имена участников доступны, либо строка вида “Participant N”, где N — номер участника в списке участников, в противном случае.
-
#offers_nums ⇒ Integer[]
Список отправленных заявок участником.
Attributes inherited from BaseType
Class Method Summary collapse
Instance Method Summary collapse
-
#firm ⇒ FirmInfo
Информация об организации.
-
#offers ⇒ AuctionOffer[]
Массив предложений.
Methods inherited from BaseType
Methods included from B2bCenterApi::WebService::TypeCast
Instance Attribute Details
#auction_id ⇒ Integer
Returns Номер аукциона/объявления.
7 8 9 |
# File 'lib/b2b_center_api/web_service/types/auction_participant.rb', line 7 def auction_id @auction_id end |
#firm_id ⇒ String
Returns ID организации участника, если имена участников доступны, либо строка вида “Participant N”, где N — номер участника в списке участников, в противном случае.
10 11 12 |
# File 'lib/b2b_center_api/web_service/types/auction_participant.rb', line 10 def firm_id @firm_id end |
#offers_nums ⇒ Integer[]
Returns Список отправленных заявок участником. Возможные значения: 0 — основное предложение целое_число — альтернативное предложение №.
15 16 17 |
# File 'lib/b2b_center_api/web_service/types/auction_participant.rb', line 15 def offers_nums @offers_nums end |
Class Method Details
.from_response(response, client, auction_id) ⇒ Array
Returns Массив B2bCenterApi::WebService::Types::AuctionParticipant.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/b2b_center_api/web_service/types/auction_participant.rb', line 18 def self.from_response(response, client, auction_id) r = response.result[:participants] return if r.nil? mas = to_array(r[:participant]).map do |p| ap = AuctionParticipant.new ap.soap_client = client ap.auction_id = auction_id ap.firm_id = convert(p[:firm_id], :string) ap.offers_nums = ArrayOfIds.from_part_response(p[:offers_nums]).flatten.map(&:to_i) ap end mas end |
Instance Method Details
#firm ⇒ FirmInfo
Returns Информация об организации.
34 35 36 37 |
# File 'lib/b2b_center_api/web_service/types/auction_participant.rb', line 34 def firm return firm_id if firm_id.include? 'Participant' remote_market.get_firm_info(firm_id) end |
#offers ⇒ AuctionOffer[]
Returns Массив предложений.
40 41 42 |
# File 'lib/b2b_center_api/web_service/types/auction_participant.rb', line 40 def offers offers_nums.map { |offer_num| remote_auction.get_offer(auction_id, firm_id, offer_num) } end |