Class: TorgApi::Api::Okdp
Overview
Справочник кодов ОКДП
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#code ⇒ Integer
Код.
-
#fullname ⇒ Integer
Полное наименование.
-
#id ⇒ Integer
Id.
-
#title ⇒ Integer
Наименование.
Class Method Summary collapse
Methods inherited from Base
attr_accessor, attributes, #initialize, #to_h, torg_resource
Constructor Details
This class inherits a constructor from TorgApi::Base
Instance Attribute Details
#code ⇒ Integer
Returns Код.
14 15 16 |
# File 'lib/torg_api/api/okdp.rb', line 14 def code @code end |
#fullname ⇒ Integer
Returns Полное наименование.
10 11 12 |
# File 'lib/torg_api/api/okdp.rb', line 10 def fullname @fullname end |
#id ⇒ Integer
Returns id.
8 9 10 |
# File 'lib/torg_api/api/okdp.rb', line 8 def id @id end |
#title ⇒ Integer
Returns Наименование.
12 13 14 |
# File 'lib/torg_api/api/okdp.rb', line 12 def title @title end |
Class Method Details
.find(id) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/torg_api/api/okdp.rb', line 17 def find(id) responce = JSON.parse( torg_resource["okdp/show"].get( params: { id: id }, accept: :json, content_type: :json, format: :json ), symbolize_names: true ) new(responce[:okdp]) end |
.find_old_code(new_value) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/torg_api/api/okdp.rb', line 30 def find_old_code(new_value) JSON.parse( torg_resource["okdp/reform_old_value"].get( params: { new_value: new_value }, accept: :json, content_type: :json, format: :json ), symbolize_names: true ) end |