Class: Vk::API::Places

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/places/types.rb,
lib/vk/api/places/checkin.rb,
lib/vk/api/places/place_full.rb,
lib/vk/api/places/methods/add.rb,
lib/vk/api/places/methods/search.rb,
lib/vk/api/places/methods/checkin.rb,
lib/vk/api/places/methods/get_by_id.rb,
lib/vk/api/places/methods/get_types.rb,
lib/vk/api/places/methods/get_checkins.rb,
lib/vk/api/places/responses/add_response.rb,
lib/vk/api/places/responses/search_response.rb,
lib/vk/api/places/responses/checkin_response.rb,
lib/vk/api/places/responses/get_by_id_response.rb,
lib/vk/api/places/responses/get_types_response.rb,
lib/vk/api/places/responses/get_checkins_response.rb

Defined Under Namespace

Modules: Methods, Responses Classes: Checkin, PlaceFull, Types

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

#add(arguments = {}) ⇒ Vk::API::Places::Responses::AddResponse

Returns Adds a new location to the location database.

Parameters:

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

Options Hash (arguments):

  • :type (Integer)

    ID of the location's type (e.g., '1' — Home, '2' — Work). To get location type IDs, use the method.

  • :title (String)

    Title of the location.

  • :latitude (Number)

    Geographical latitude, in degrees (from '-90' to '90').

  • :longitude (Number)

    Geographical longitude, in degrees (from '-180' to '180').

  • :country (Integer)

    ID of the location's country. To get country IDs, use the method.

  • :city (Integer)

    ID of the location's city. To get city IDs, use the method.

  • :address (String)

    Street address of the location (e.g., '125 Elm Street').

Returns:

See Also:



3710
3711
3712
3713
3714
3715
3716
# File 'lib/vk/api/methods.rb', line 3710

def add(arguments = {})
  require "vk/api/places/methods/add"
  method = Methods::Add.new(arguments)
  response = method.call(@client)
  require "vk/api/places/responses/add_response"
  Responses::AddResponse.new(response.deep_symbolize_keys)
end

#checkin(arguments = {}) ⇒ Vk::API::Places::Responses::CheckinResponse

Returns Checks a user in at the specified location.

Parameters:

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

Options Hash (arguments):

  • :place_id (Integer)

    Location ID.

  • :text (String)

    Text of the comment on the check-in (255 characters maximum; line breaks not supported).

  • :latitude (Number)

    Geographical latitude of the check-in, in degrees (from '-90' to '90').

  • :longitude (Number)

    Geographical longitude of the check-in, in degrees (from '-180' to '180').

  • :friends_only (Boolean)

    '1' — Check-in will be available only for friends.; '0' — Check-in will be available for all users (default).

  • :services (Array)

    List of services or websites (e.g., 'twitter', 'facebook') to which the check-in will be exported, if the user has set up the respective option.

Returns:

See Also:



3754
3755
3756
3757
3758
3759
3760
# File 'lib/vk/api/methods.rb', line 3754

def checkin(arguments = {})
  require "vk/api/places/methods/checkin"
  method = Methods::Checkin.new(arguments)
  response = method.call(@client)
  require "vk/api/places/responses/checkin_response"
  Responses::CheckinResponse.new(response.deep_symbolize_keys)
end

#get_by_id(arguments = {}) ⇒ Vk::API::Places::Responses::GetByIdResponse

Returns information about locations by their IDs.

Parameters:

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

Options Hash (arguments):

  • :places (Array)

    Location IDs.

Returns:

See Also:



3721
3722
3723
3724
3725
3726
3727
# File 'lib/vk/api/methods.rb', line 3721

def get_by_id(arguments = {})
  require "vk/api/places/methods/get_by_id"
  method = Methods::GetById.new(arguments)
  response = method.call(@client)
  require "vk/api/places/responses/get_by_id_response"
  Responses::GetByIdResponse.new(response.deep_symbolize_keys)
end

#get_checkins(arguments = {}) ⇒ Vk::API::Places::Responses::GetCheckinsResponse

Returns a list of user check-ins at locations according to the set parameters.

Parameters:

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

Options Hash (arguments):

  • :latitude (Number)

    Geographical latitude of the initial search point, in degrees (from '-90' to '90').

  • :longitude (Number)

    Geographical longitude of the initial search point, in degrees (from '-180' to '180').

  • :place (Integer)

    Location ID of check-ins to return. (Ignored if 'latitude' and 'longitude' are specified.)

  • :user_id (Integer)
  • :offset (Integer)

    Offset needed to return a specific subset of check-ins. (Ignored if 'timestamp' is not null.)

  • :count (Integer) — default: 20

    Number of check-ins to return. (Ignored if 'timestamp' is not null.)

  • :timestamp (Integer)

    Specifies that only those check-ins created after the specified timestamp will be returned.

  • :friends_only (Boolean)

    '1' — to return only check-ins with set geographical coordinates. (Ignored if 'latitude' and 'longitude' are not set.)

  • :need_places (Boolean)

    '1' — to return location information with the check-ins. (Ignored if 'place' is not set.);

Returns:

See Also:



3773
3774
3775
3776
3777
3778
3779
# File 'lib/vk/api/methods.rb', line 3773

def get_checkins(arguments = {})
  require "vk/api/places/methods/get_checkins"
  method = Methods::GetCheckins.new(arguments)
  response = method.call(@client)
  require "vk/api/places/responses/get_checkins_response"
  Responses::GetCheckinsResponse.new(response.deep_symbolize_keys)
end

#get_types(arguments = {}) ⇒ Vk::API::Places::Responses::GetTypesResponse

Returns a list of all types of locations.

Parameters:

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

Returns:

See Also:



3783
3784
3785
3786
3787
3788
3789
# File 'lib/vk/api/methods.rb', line 3783

def get_types(arguments = {})
  require "vk/api/places/methods/get_types"
  method = Methods::GetTypes.new(arguments)
  response = method.call(@client)
  require "vk/api/places/responses/get_types_response"
  Responses::GetTypesResponse.new(response.deep_symbolize_keys)
end

#search(arguments = {}) ⇒ Vk::API::Places::Responses::SearchResponse

Returns a list of locations that match the search criteria.

Parameters:

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

Options Hash (arguments):

  • :q (String)

    Search query string.

  • :city (Integer)

    City ID.

  • :latitude (Number)

    Geographical latitude of the initial search point, in degrees (from '-90' to '90').

  • :longitude (Number)

    Geographical longitude of the initial search point, in degrees (from '-180' to '180').

  • :radius (Integer)

    Radius of the search zone:; '1' — 100 m. (default); '2' — 800 m.; '3' — 6 km.; '4' — 50 km.

  • :offset (Integer)

    Offset needed to return a specific subset of locations.

  • :count (Integer) — default: 30

    Number of locations to return.

Returns:

See Also:



3738
3739
3740
3741
3742
3743
3744
# File 'lib/vk/api/methods.rb', line 3738

def search(arguments = {})
  require "vk/api/places/methods/search"
  method = Methods::Search.new(arguments)
  response = method.call(@client)
  require "vk/api/places/responses/search_response"
  Responses::SearchResponse.new(response.deep_symbolize_keys)
end