Class: TorgApi::Api::Department

Inherits:
Base
  • Object
show all
Defined in:
lib/torg_api/api/department.rb

Overview

Подразделение заказчика в ТОРГ

Constant Summary

Constants inherited from Base

Base::REMOVE_HASH_ATTRS

Instance Attribute Summary collapse

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

#ancestryString

Returns Родословная.

Returns:

  • (String)

    Родословная



24
25
26
# File 'lib/torg_api/api/department.rb', line 24

def ancestry
  @ancestry
end

#contactArray

Returns Контактная информация.

Returns:

  • (Array)

    Контактная информация



42
43
44
# File 'lib/torg_api/api/department.rb', line 42

def contact
  @contact
end

#eis223_limitNumeric

Returns Лимит по 223 ФЗ.

Returns:

  • (Numeric)

    Лимит по 223 ФЗ



38
39
40
# File 'lib/torg_api/api/department.rb', line 38

def eis223_limit
  @eis223_limit
end

#etp_idInteger

Returns id на ЭТП.

Returns:

  • (Integer)

    id на ЭТП



22
23
24
# File 'lib/torg_api/api/department.rb', line 22

def etp_id
  @etp_id
end

#fact_addressString

Returns Фактический адрес.

Returns:

  • (String)

    Фактический адрес



16
17
18
# File 'lib/torg_api/api/department.rb', line 16

def fact_address
  @fact_address
end

#fullnameString

Returns Полное наименование.

Returns:

  • (String)

    Полное наименование



26
27
28
# File 'lib/torg_api/api/department.rb', line 26

def fullname
  @fullname
end

#idInteger

Returns id.

Returns:

  • (Integer)

    id



8
9
10
# File 'lib/torg_api/api/department.rb', line 8

def id
  @id
end

#innInteger

Returns ИНН.

Returns:

  • (Integer)

    ИНН



28
29
30
# File 'lib/torg_api/api/department.rb', line 28

def inn
  @inn
end

#is_consumerBoolean

Returns Является потребителем.

Returns:

  • (Boolean)

    Является потребителем



36
37
38
# File 'lib/torg_api/api/department.rb', line 36

def is_consumer
  @is_consumer
end

#is_customerBoolean

Returns Является заказчиком?.

Returns:

  • (Boolean)

    Является заказчиком?



18
19
20
# File 'lib/torg_api/api/department.rb', line 18

def is_customer
  @is_customer
end

#is_organizerBoolean

Returns Является организатором?.

Returns:

  • (Boolean)

    Является организатором?



20
21
22
# File 'lib/torg_api/api/department.rb', line 20

def is_organizer
  @is_organizer
end

#kppInteger

Returns КПП.

Returns:

  • (Integer)

    КПП



30
31
32
# File 'lib/torg_api/api/department.rb', line 30

def kpp
  @kpp
end

Returns Юридический адрес.

Returns:

  • (String)

    Юридический адрес



14
15
16
# File 'lib/torg_api/api/department.rb', line 14

def legal_address
  @legal_address
end

#nameString

Returns Наименование.

Returns:

  • (String)

    Наименование



12
13
14
# File 'lib/torg_api/api/department.rb', line 12

def name
  @name
end

#ownershipArray

Returns Форма собственности.

Returns:

  • (Array)

    Форма собственности



40
41
42
# File 'lib/torg_api/api/department.rb', line 40

def ownership
  @ownership
end

#ownership_idInteger

Returns id формы собственности.

Returns:

  • (Integer)

    id формы собственности



32
33
34
# File 'lib/torg_api/api/department.rb', line 32

def ownership_id
  @ownership_id
end

#parent_dept_idInteger

Returns id подразделения верхнего уровня.

Returns:

  • (Integer)

    id подразделения верхнего уровня



10
11
12
# File 'lib/torg_api/api/department.rb', line 10

def parent_dept_id
  @parent_dept_id
end

#shortnameString

Returns Краткое наименование.

Returns:

  • (String)

    Краткое наименование



34
35
36
# File 'lib/torg_api/api/department.rb', line 34

def shortname
  @shortname
end

Class Method Details

.find(id) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/torg_api/api/department.rb', line 46

def find(id)
  responce = JSON.parse(
    torg_resource["departments/#{id}"].get(
      accept: :json,
      content_type: :json,
      format: :json
    ),
    symbolize_names: true
  )
  new(responce[:department])
end