Class: B2bCenterApi::WebService::Types::AuctionParticipant

Inherits:
BaseType
  • Object
show all
Defined in:
lib/b2b_center_api/web_service/types/auction_participant.rb

Overview

Участник аукциона

Constant Summary

Constants inherited from BaseType

BaseType::NO_INSPECT_ATTRS

Instance Attribute Summary collapse

Attributes inherited from BaseType

#date_fields, #soap_client

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseType

#inspect, #to_h

Methods included from B2bCenterApi::WebService::TypeCast

included

Instance Attribute Details

#auction_idInteger

Returns Номер аукциона/объявления.

Returns:

  • (Integer)

    Номер аукциона/объявления



7
8
9
# File 'lib/b2b_center_api/web_service/types/auction_participant.rb', line 7

def auction_id
  @auction_id
end

#firm_idString

Returns ID организации участника, если имена участников доступны, либо строка вида “Participant N”, где N — номер участника в списке участников, в противном случае.

Returns:

  • (String)

    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_numsInteger[]

Returns Список отправленных заявок участником. Возможные значения: 0 — основное предложение целое_число — альтернативное предложение №.

Returns:

  • (Integer[])

    Список отправленных заявок участником. Возможные значения: 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:



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

#firmFirmInfo

Returns Информация об организации.

Returns:

  • (FirmInfo)

    Информация об организации



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

#offersAuctionOffer[]

Returns Массив предложений.

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