Class: Vk::API::Likes

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/methods.rb,
lib/vk/api/responses.rb,
lib/vk/api/likes/methods/add.rb,
lib/vk/api/likes/methods/delete.rb,
lib/vk/api/likes/methods/get_list.rb,
lib/vk/api/likes/methods/is_liked.rb,
lib/vk/api/likes/responses/add_response.rb,
lib/vk/api/likes/responses/delete_response.rb,
lib/vk/api/likes/responses/get_list_response.rb,
lib/vk/api/likes/responses/is_liked_response.rb

Defined Under Namespace

Modules: Methods, Responses

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::Likes::Responses::AddResponse

Returns Adds the specified object to the 'Likes' list of the current user.

Parameters:

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

Options Hash (arguments):

  • :type (String)

    Object type:; 'post' — post on user or community wall; 'comment' — comment on a wall post; 'photo' — photo; 'audio' — audio; 'video' — video; 'note' — note; 'photo_comment' — comment on the photo; 'video_comment' — comment on the video; 'topic_comment' — comment in the discussion; 'sitepage' — page of the site where the is installed

  • :owner_id (Integer)

    ID of the user or community that owns the object.

  • :item_id (Integer)

    Object ID.

  • :access_key (String)

    Access key required for an object owned by a private entity.;

Returns:

See Also:


4711
4712
4713
4714
4715
4716
4717
# File 'lib/vk/api/methods.rb', line 4711

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

#delete(arguments = {}) ⇒ Vk::API::Likes::Responses::DeleteResponse

Returns Deletes the specified object from the 'Likes' list of the current user.

Parameters:

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

Options Hash (arguments):

  • :type (String)

    Object type:; 'post' — post on user or community wall; 'comment' — comment on a wall post; 'photo' — photo; 'audio' — audio; 'video' — video; 'note' — note; 'photo_comment' — comment on the photo; 'video_comment' — comment on the video; 'topic_comment' — comment in the discussion; 'sitepage' — page of the site where the is installed

  • :owner_id (Integer)

    ID of the user or community that owns the object.

  • :item_id (Integer)

    Object ID.

Returns:

See Also:


4724
4725
4726
4727
4728
4729
4730
# File 'lib/vk/api/methods.rb', line 4724

def delete(arguments = {})
  require "vk/api/likes/methods/delete"
  method = Methods::Delete.new(arguments)
  response = method.call(@client)
  require "vk/api/likes/responses/delete_response"
  Responses::DeleteResponse.new(response.deep_symbolize_keys)
end

#get_list(arguments = {}) ⇒ Vk::API::Likes::Responses::GetListResponse

Returns a list of IDs of users who added the specified object to their 'Likes' list.

Parameters:

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

Options Hash (arguments):

  • :type (String)

    ; Object type:; 'post' — post on user or community wall; 'comment' — comment on a wall post; 'photo' — photo; 'audio' — audio; 'video' — video; 'note' — note; 'photo_comment' — comment on the photo; 'video_comment' — comment on the video; 'topic_comment' — comment in the discussion; 'sitepage' — page of the site where the is installed

  • :owner_id (Integer)

    ID of the user, community, or application that owns the object. If the 'type' parameter is set as 'sitepage', the application ID is passed as 'owner_id'. Use negative value for a community id. If the 'type' parameter is not set, the 'owner_id' is assumed to be either the current user or the same application ID as if the 'type' parameter was set to 'sitepage'.; ;

  • :item_id (Integer)

    Object ID. If 'type' is set as 'sitepage', 'item_id' can include the 'page_id' parameter value used during initialization of the .

  • :page_url (String)

    URL of the page where the is installed. Used instead of the 'item_id' parameter.

  • :filter (String)

    Filters to apply:; 'likes' — returns information about all users who liked the object (default); 'copies' — returns information only about users who told their friends about the object

  • :friends_only (Boolean)

    Specifies which users are returned:; '1' — to return only the current user's friends; '0' — to return all users (default)

  • :extended (Boolean)

    Specifies whether extended information will be returned.; '1' — to return extended information about users and communities from the 'Likes' list; '0' — to return no additional information (default)

  • :offset (Integer)

    Offset needed to select a specific subset of users.

  • :count (Integer)

    Number of user IDs to return (maximum '1000').; Default is '100' if 'friends_only' is set to '0'; otherwise, the default is '10' if 'friends_only' is set to '1'.;

  • :skip_own (Boolean)

Returns:

See Also:


4697
4698
4699
4700
4701
4702
4703
# File 'lib/vk/api/methods.rb', line 4697

def get_list(arguments = {})
  require "vk/api/likes/methods/get_list"
  method = Methods::GetList.new(arguments)
  response = method.call(@client)
  require "vk/api/likes/responses/get_list_response"
  Responses::GetListResponse.new(response.deep_symbolize_keys)
end

#is_liked(arguments = {}) ⇒ Vk::API::Likes::Responses::IsLikedResponse

Returns Checks for the object in the 'Likes' list of the specified user.

Parameters:

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

Options Hash (arguments):

  • :user_id (Integer)

    User ID.

  • :type (String)

    Object type:; 'post' — post on user or community wall; 'comment' — comment on a wall post; 'photo' — photo; 'audio' — audio; 'video' — video; 'note' — note; 'photo_comment' — comment on the photo; 'video_comment' — comment on the video; 'topic_comment' — comment in the discussion

  • :owner_id (Integer)

    ID of the user or community that owns the object.

  • :item_id (Integer)

    Object ID.

Returns:

See Also:


4738
4739
4740
4741
4742
4743
4744
# File 'lib/vk/api/methods.rb', line 4738

def is_liked(arguments = {})
  require "vk/api/likes/methods/is_liked"
  method = Methods::IsLiked.new(arguments)
  response = method.call(@client)
  require "vk/api/likes/responses/is_liked_response"
  Responses::IsLikedResponse.new(response.deep_symbolize_keys)
end