class TorgApi::Api::Lot

Лот

Attributes

id[RW]

@return [Integer] id

num[RW]

@return [Integer] Номер

specifications[RW]

@return [Array] Спецификации

Public Class Methods

find(tender_id, num) click to toggle source

Поиск закупки по id @param id [Integer] id закупки @return [Tender] возвращает объект закупки

# File lib/torg_api/api/lot.rb, line 15
def find(tender_id, num)
  responce = JSON.parse(
    torg_resource["tenders/#{tender_id}"].get(
      accept: :json,
      content_type: :json,
      format: :json
    ),
    symbolize_names: true
  )
  lot = responce[:lots].select { |value| value[:num] == num }.first
  new(lot) if lot
end