torg_api 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ece061e63e2f7c1a28cce2e4493325def4de2ac
4
- data.tar.gz: 19531be5ec8f347258465cf188b974ce34371e55
3
+ metadata.gz: 488581134aa036b0d5cda63dcf269bdbd222aec0
4
+ data.tar.gz: d96799c73e1ff9c94ad4af630e7aad91d0d409e5
5
5
  SHA512:
6
- metadata.gz: 9353e14d4a79ebe61061f9304ab3b25ec6e881a035296b33a8c1fb855cacd0aca63e640603b4681d109770027c21e01afcb68309c7525b6d67fb4ce838a59e42
7
- data.tar.gz: 51f09a546aff408cf6912cfbb833b69c4058aeb948914cfa622ddb3ebe0d00f9bef8fb4f1c54955f100e2f32670a54c0217c00b009f2a8243e0889f102492e1f
6
+ metadata.gz: 1a86cc50448cddbff2896e54dc88ca560f13dfb3972ff70965cbd7efda08d93d09f9f9bd6b04e54b699e605e2a144249ac8deb96d477bd7b5aac916264b10e71
7
+ data.tar.gz: d1bb738fa67ed620cbef2794aaba2430ac8c6acf20b3ea753355ba7cedc91c81ee87c601548e6ca2e857ab9cd0feb558f2b452ebb9a472c9552e9e2cead56189
@@ -0,0 +1,20 @@
1
+ module TorgApi
2
+ module Api
3
+ # Лот
4
+ class Lot < TorgApi::Base
5
+ # @return [Integer] id
6
+ attr_accessor :id
7
+ # @return [Integer] Номер
8
+ attr_accessor :num
9
+
10
+ class << self
11
+ # Поиск закупки по id
12
+ # @param id [Integer] id закупки
13
+ # @return [Tender] возвращает объект закупки
14
+ def find(tender_id, num)
15
+ TorgApi::Models::Lot.where(tender_id: tender_id, num: num).take.to_api
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -135,6 +135,10 @@ module TorgApi
135
135
  TorgApi::Models::Bidder.where(tender_id: id, contractor_id: contractor_id).first.try(:id)
136
136
  end
137
137
 
138
+ def find_lot(num)
139
+ Lot.find(id, num)
140
+ end
141
+
138
142
  class << self
139
143
  # Поиск закупки по id
140
144
  # @param id [Integer] id закупки
@@ -0,0 +1,13 @@
1
+ module TorgApi
2
+ module Models
3
+ # Лот
4
+ class Lot < ActiveRecord::Base
5
+ def to_api
6
+ t = TorgApi::Api::Lot.new
7
+ t.id = id
8
+ t.num = num
9
+ t
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module TorgApi
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torg_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Archakov Aleksandr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-04 00:00:00.000000000 Z
11
+ date: 2015-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,6 +69,7 @@ files:
69
69
  - lib/torg_api/api.rb
70
70
  - lib/torg_api/api/bidder.rb
71
71
  - lib/torg_api/api/contractor.rb
72
+ - lib/torg_api/api/lot.rb
72
73
  - lib/torg_api/api/offer.rb
73
74
  - lib/torg_api/api/tender.rb
74
75
  - lib/torg_api/base.rb
@@ -77,6 +78,7 @@ files:
77
78
  - lib/torg_api/models/bidder.rb
78
79
  - lib/torg_api/models/contractor.rb
79
80
  - lib/torg_api/models/cover.rb
81
+ - lib/torg_api/models/lot.rb
80
82
  - lib/torg_api/models/offer.rb
81
83
  - lib/torg_api/models/offer_specification.rb
82
84
  - lib/torg_api/models/specification.rb
@@ -103,9 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
105
  version: '0'
104
106
  requirements: []
105
107
  rubyforge_project:
106
- rubygems_version: 2.2.0
108
+ rubygems_version: 2.2.2
107
109
  signing_key:
108
110
  specification_version: 4
109
111
  summary: Torg API
110
112
  test_files: []
111
- has_rdoc: