Class: TorgApi::Api::User

Inherits:
Base
  • Object
show all
Defined in:
lib/torg_api/api/user.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

#department_idInteger

Returns ID подразделения.

Returns:

  • (Integer)

    ID подразделения



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

def department_id
  @department_id
end

#emailInteger

Returns Электронная почта.

Returns:

  • (Integer)

    Электронная почта



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

def email
  @email
end

#faxInteger

Returns Факс.

Returns:

  • (Integer)

    Факс



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

def fax
  @fax
end

#idInteger

Returns id.

Returns:

  • (Integer)

    id



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

def id
  @id
end

#nameInteger

Returns Имя.

Returns:

  • (Integer)

    Имя



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

def name
  @name
end

#patronymicInteger

Returns Отчество.

Returns:

  • (Integer)

    Отчество



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

def patronymic
  @patronymic
end

#phone_cellInteger

Returns Телефон сотовый.

Returns:

  • (Integer)

    Телефон сотовый



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

def phone_cell
  @phone_cell
end

#phone_publicInteger

Returns Телефон рабочий.

Returns:

  • (Integer)

    Телефон рабочий



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

def phone_public
  @phone_public
end

#surnameInteger

Returns Фамилия.

Returns:

  • (Integer)

    Фамилия



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

def surname
  @surname
end

#user_jobInteger

Returns Должность.

Returns:

  • (Integer)

    Должность



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

def user_job
  @user_job
end

Class Method Details

.find(id) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/torg_api/api/user.rb', line 29

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