Class: Vkontakte::App::Iframe
- Includes:
- Vkontakte::Api::Friends, Vkontakte::Api::Groups, Vkontakte::Api::Likes, Vkontakte::Api::Photos
- Defined in:
- lib/vkontakte/app/iframe.rb
Overview
IFrame приложения More info at vk.com/developers.php?id=-1_27971896&s=1
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Attributes inherited from Base
Instance Method Summary collapse
-
#api_result ⇒ Object
результат выполнения API-запроса, формирующийся при просмотре приложения.
-
#language ⇒ Object
Переменная language может принимать следующие значения:.
-
#valid_auth_key? ⇒ Boolean
Этот параметр приходит, если в приложении включена система платежей (во вкладке Платежи при редактировании приложения).
Methods included from Vkontakte::Api::Photos
Methods included from Vkontakte::Api::Likes
Methods included from Vkontakte::Api::Groups
Methods included from Vkontakte::Api::Friends
Methods inherited from Base
#authorize, #authorized?, #call, #initialize
Constructor Details
This class inherits a constructor from Vkontakte::App::Base
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
12 13 14 |
# File 'lib/vkontakte/app/iframe.rb', line 12 def params @params end |
Instance Method Details
#api_result ⇒ Object
результат выполнения API-запроса, формирующийся при просмотре приложения. Параметры этого запроса можно ввести в разделе редактирования приложения. Например, для получения информации об указанных пользователях, можно использовать следующий запрос:
method=getProfiles&uids={user_id},{viewer_id},1,6492&format=json&v=2.0
59 60 61 |
# File 'lib/vkontakte/app/iframe.rb', line 59 def api_result @api_result ||= MultiJson.decode(params[:api_result]) end |
#language ⇒ Object
Переменная language может принимать следующие значения:
0 – русский язык.
1 – украинский язык.
2 – белорусский язык.
3 – английский язык.
44 45 46 47 48 49 50 51 52 |
# File 'lib/vkontakte/app/iframe.rb', line 44 def language return :ru if params[:language].blank? case params[:language].to_s when '0' then :ru when '1' then :uk when '2' then :be when '3' then :en end end |
#valid_auth_key? ⇒ Boolean
Этот параметр приходит, если в приложении включена система платежей (во вкладке Платежи при редактировании приложения). auth_key вычисляется на сервере ВКонтакте следующим образом:
auth_key = md5(api_id + '_' + viewer_id + '_' + api_secret)
33 34 35 |
# File 'lib/vkontakte/app/iframe.rb', line 33 def valid_auth_key? !params[:auth_key].blank? && params[:auth_key] == auth_key end |