Class: TorgApi::Api::Okved

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

#codeInteger

Returns Код.

Returns:

  • (Integer)

    Код



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

def code
  @code
end

#fullnameInteger

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

Returns:

  • (Integer)

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



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

def fullname
  @fullname
end

#idInteger

Returns id.

Returns:

  • (Integer)

    id



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

def id
  @id
end

#titleInteger

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

Returns:

  • (Integer)

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



12
13
14
# File 'lib/torg_api/api/okved.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/okved.rb', line 17

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