Class: Vk::API::Database

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/methods.rb,
lib/vk/api/objects.rb,
lib/vk/api/responses.rb,
lib/vk/api/database/city.rb,
lib/vk/api/database/region.rb,
lib/vk/api/database/school.rb,
lib/vk/api/database/street.rb,
lib/vk/api/database/faculty.rb,
lib/vk/api/database/university.rb,
lib/vk/api/database/methods/get_chairs.rb,
lib/vk/api/database/methods/get_cities.rb,
lib/vk/api/database/methods/get_regions.rb,
lib/vk/api/database/methods/get_schools.rb,
lib/vk/api/database/methods/get_countries.rb,
lib/vk/api/database/methods/get_faculties.rb,
lib/vk/api/database/methods/get_cities_by_id.rb,
lib/vk/api/database/methods/get_universities.rb,
lib/vk/api/database/methods/get_streets_by_id.rb,
lib/vk/api/database/methods/get_school_classes.rb,
lib/vk/api/database/methods/get_countries_by_id.rb,
lib/vk/api/database/responses/get_chairs_response.rb,
lib/vk/api/database/responses/get_cities_response.rb,
lib/vk/api/database/responses/get_regions_response.rb,
lib/vk/api/database/responses/get_schools_response.rb,
lib/vk/api/database/responses/get_countries_response.rb,
lib/vk/api/database/responses/get_faculties_response.rb,
lib/vk/api/database/responses/get_cities_by_id_response.rb,
lib/vk/api/database/responses/get_universities_response.rb,
lib/vk/api/database/responses/get_streets_by_id_response.rb,
lib/vk/api/database/responses/get_school_classes_response.rb,
lib/vk/api/database/responses/get_countries_by_id_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: City, Faculty, Region, School, Street, University

Instance Attribute Summary

Attributes inherited from Schema::Namespace

#client

DSL collapse

Methods inherited from Schema::Namespace

#call, #initialize

Constructor Details

This class inherits a constructor from Vk::Schema::Namespace

Instance Method Details

#get_chairs(arguments = {}) ⇒ Vk::API::Database::Responses::GetChairsResponse

Returns list of chairs on a specified faculty.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :faculty_id (Integer)

    id of the faculty to get chairs from

  • :offset (Integer)

    offset required to get a certain subset of chairs

  • :count (Integer) — default: 100

    amount of chairs to get

Returns:

See Also:



5558
5559
5560
5561
5562
5563
5564
# File 'lib/vk/api/methods.rb', line 5558

def get_chairs(arguments = {})
  require "vk/api/database/methods/get_chairs"
  method = Methods::GetChairs.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_chairs_response"
  Responses::GetChairsResponse.new(response.deep_symbolize_keys)
end

#get_cities(arguments = {}) ⇒ Vk::API::Database::Responses::GetCitiesResponse

Returns a list of cities.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :country_id (Integer)

    Country ID.

  • :region_id (Integer)

    Region ID.

  • :q (String)

    Search query.

  • :need_all (Boolean)

    '1' — to return all cities in the country; '0' — to return major cities in the country (default);

  • :offset (Integer)

    Offset needed to return a specific subset of cities.

  • :count (Integer) — default: 100

    Number of cities to return.

Returns:

See Also:



5481
5482
5483
5484
5485
5486
5487
# File 'lib/vk/api/methods.rb', line 5481

def get_cities(arguments = {})
  require "vk/api/database/methods/get_cities"
  method = Methods::GetCities.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_cities_response"
  Responses::GetCitiesResponse.new(response.deep_symbolize_keys)
end

#get_cities_by_id(arguments = {}) ⇒ Vk::API::Database::Responses::GetCitiesByIdResponse

Returns information about cities by their IDs.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :city_ids (Array)

    City IDs.

Returns:

See Also:



5492
5493
5494
5495
5496
5497
5498
# File 'lib/vk/api/methods.rb', line 5492

def get_cities_by_id(arguments = {})
  require "vk/api/database/methods/get_cities_by_id"
  method = Methods::GetCitiesById.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_cities_by_id_response"
  Responses::GetCitiesByIdResponse.new(response.deep_symbolize_keys)
end

#get_countries(arguments = {}) ⇒ Vk::API::Database::Responses::GetCountriesResponse

Returns a list of countries.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :need_all (Boolean)

    '1' — to return a full list of all countries; '0' — to return a list of countries near the current user's country (default).;

  • :code (String)

    Country codes in standard.

  • :offset (Integer)

    Offset needed to return a specific subset of countries.

  • :count (Integer) — default: 100

    Number of countries to return.

Returns:

See Also:



5429
5430
5431
5432
5433
5434
5435
# File 'lib/vk/api/methods.rb', line 5429

def get_countries(arguments = {})
  require "vk/api/database/methods/get_countries"
  method = Methods::GetCountries.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_countries_response"
  Responses::GetCountriesResponse.new(response.deep_symbolize_keys)
end

#get_countries_by_id(arguments = {}) ⇒ Vk::API::Database::Responses::GetCountriesByIdResponse

Returns information about countries by their IDs.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :country_ids (Array)

    Country IDs.

Returns:

See Also:



5465
5466
5467
5468
5469
5470
5471
# File 'lib/vk/api/methods.rb', line 5465

def get_countries_by_id(arguments = {})
  require "vk/api/database/methods/get_countries_by_id"
  method = Methods::GetCountriesById.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_countries_by_id_response"
  Responses::GetCountriesByIdResponse.new(response.deep_symbolize_keys)
end

#get_faculties(arguments = {}) ⇒ Vk::API::Database::Responses::GetFacultiesResponse

Returns a list of faculties (i.e., university departments).;

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :university_id (Integer)

    University ID.

  • :offset (Integer)

    Offset needed to return a specific subset of faculties.

  • :count (Integer) — default: 100

    Number of faculties to return.

Returns:

See Also:



5545
5546
5547
5548
5549
5550
5551
# File 'lib/vk/api/methods.rb', line 5545

def get_faculties(arguments = {})
  require "vk/api/database/methods/get_faculties"
  method = Methods::GetFaculties.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_faculties_response"
  Responses::GetFacultiesResponse.new(response.deep_symbolize_keys)
end

#get_regions(arguments = {}) ⇒ Vk::API::Database::Responses::GetRegionsResponse

Returns a list of regions.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :country_id (Integer)

    Country ID, received in method.

  • :q (String)

    Search query.

  • :offset (Integer)

    Offset needed to return specific subset of regions.

  • :count (Integer) — default: 100

    Number of regions to return.

Returns:

See Also:



5443
5444
5445
5446
5447
5448
5449
# File 'lib/vk/api/methods.rb', line 5443

def get_regions(arguments = {})
  require "vk/api/database/methods/get_regions"
  method = Methods::GetRegions.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_regions_response"
  Responses::GetRegionsResponse.new(response.deep_symbolize_keys)
end

#get_school_classes(arguments = {}) ⇒ Vk::API::Database::Responses::GetSchoolClassesResponse

Returns a list of school classes specified for the country.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :country_id (Integer)

    Country ID.

Returns:

See Also:



5532
5533
5534
5535
5536
5537
5538
# File 'lib/vk/api/methods.rb', line 5532

def get_school_classes(arguments = {})
  require "vk/api/database/methods/get_school_classes"
  method = Methods::GetSchoolClasses.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_school_classes_response"
  Responses::GetSchoolClassesResponse.new(response.deep_symbolize_keys)
end

#get_schools(arguments = {}) ⇒ Vk::API::Database::Responses::GetSchoolsResponse

Returns a list of schools.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :q (String)

    Search query.

  • :city_id (Integer)

    City ID.

  • :offset (Integer)

    Offset needed to return a specific subset of schools.

  • :count (Integer) — default: 100

    Number of schools to return.

Returns:

See Also:



5521
5522
5523
5524
5525
5526
5527
# File 'lib/vk/api/methods.rb', line 5521

def get_schools(arguments = {})
  require "vk/api/database/methods/get_schools"
  method = Methods::GetSchools.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_schools_response"
  Responses::GetSchoolsResponse.new(response.deep_symbolize_keys)
end

#get_streets_by_id(arguments = {}) ⇒ Vk::API::Database::Responses::GetStreetsByIdResponse

Returns information about streets by their IDs.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :street_ids (Array)

    Street IDs.

Returns:

See Also:



5454
5455
5456
5457
5458
5459
5460
# File 'lib/vk/api/methods.rb', line 5454

def get_streets_by_id(arguments = {})
  require "vk/api/database/methods/get_streets_by_id"
  method = Methods::GetStreetsById.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_streets_by_id_response"
  Responses::GetStreetsByIdResponse.new(response.deep_symbolize_keys)
end

#get_universities(arguments = {}) ⇒ Vk::API::Database::Responses::GetUniversitiesResponse

Returns a list of higher education institutions.

Parameters:

  • arguments (Hash) (defaults to: {})

Options Hash (arguments):

  • :q (String)

    Search query.

  • :country_id (Integer)

    Country ID.

  • :city_id (Integer)

    City ID.

  • :offset (Integer)

    Offset needed to return a specific subset of universities.

  • :count (Integer) — default: 100

    Number of universities to return.

Returns:

See Also:



5507
5508
5509
5510
5511
5512
5513
# File 'lib/vk/api/methods.rb', line 5507

def get_universities(arguments = {})
  require "vk/api/database/methods/get_universities"
  method = Methods::GetUniversities.new(arguments)
  response = method.call(@client)
  require "vk/api/database/responses/get_universities_response"
  Responses::GetUniversitiesResponse.new(response.deep_symbolize_keys)
end