Class: Vk::API::Storage

Inherits:
Schema::Namespace show all
Defined in:
lib/vk/api/methods.rb,
lib/vk/api/responses.rb,
lib/vk/api/storage/methods/get.rb,
lib/vk/api/storage/methods/set.rb,
lib/vk/api/storage/methods/get_keys.rb,
lib/vk/api/storage/responses/get_response.rb,
lib/vk/api/storage/responses/set_response.rb,
lib/vk/api/storage/responses/get_keys_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

#get(arguments = {}) ⇒ Vk::API::Storage::Responses::GetResponse

Returns a value of variable with the name set by key parameter.

Parameters:

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

Options Hash (arguments):

Returns:

See Also:



1666
1667
1668
1669
1670
1671
1672
# File 'lib/vk/api/methods.rb', line 1666

def get(arguments = {})
  require "vk/api/storage/methods/get"
  method = Methods::Get.new(arguments)
  response = method.call(@client)
  require "vk/api/storage/responses/get_response"
  Responses::GetResponse.new(response.deep_symbolize_keys)
end

#get_keys(arguments = {}) ⇒ Vk::API::Storage::Responses::GetKeysResponse

Returns the names of all variables.

Parameters:

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

Options Hash (arguments):

  • :user_id (Integer)

    user id, whose variables names are returned if they were requested with a server method.

  • :count (Integer) — default: 100

    amount of variable names the info needs to be collected from.

Returns:

See Also:



1691
1692
1693
1694
1695
1696
1697
# File 'lib/vk/api/methods.rb', line 1691

def get_keys(arguments = {})
  require "vk/api/storage/methods/get_keys"
  method = Methods::GetKeys.new(arguments)
  response = method.call(@client)
  require "vk/api/storage/responses/get_keys_response"
  Responses::GetKeysResponse.new(response.deep_symbolize_keys)
end

#set(arguments = {}) ⇒ Vk::API::Storage::Responses::SetResponse

Returns Saves a value of variable with the name set by 'key' parameter.

Parameters:

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

Options Hash (arguments):

Returns:

See Also:



1679
1680
1681
1682
1683
1684
1685
# File 'lib/vk/api/methods.rb', line 1679

def set(arguments = {})
  require "vk/api/storage/methods/set"
  method = Methods::Set.new(arguments)
  response = method.call(@client)
  require "vk/api/storage/responses/set_response"
  Responses::SetResponse.new(response.deep_symbolize_keys)
end