Class: Ipizza::AuthenticationResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/ipizza/authentication_response.rb

Constant Summary

Constants inherited from Response

Response::PARAM_ORDER

Instance Attribute Summary

Attributes inherited from Response

#verify_params, #verify_params_order

Instance Method Summary collapse

Methods inherited from Response

#initialize, #verify

Constructor Details

This class inherits a constructor from Ipizza::Response

Instance Method Details

#authentication_infoObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/ipizza/authentication_response.rb', line 20

def authentication_info
  @authentication_info ||= Ipizza::Authentication.new(
    provider: @params['VK_SND_ID'],
    user: @params['VK_USER'],
    message_time: @params['VK_DATETIME'],
    sender_id: @params['VK_SND_ID'],
    receiver_id: @params['VK_REC_ID'],
    user_name: @params['VK_USER_NAME'],
    user_id: @params['VK_USER_ID'],
    country: @params['VK_COUNTRY'],
    other: @params['VK_OTHER'],
    authentication_identifier: @params['VK_TOKEN'],
    request_identifier: @params['VK_RID'],
    nonce: @params['VK_NONCE']
  )
end

#info_nameObject



16
17
18
# File 'lib/ipizza/authentication_response.rb', line 16

def info_name
  authentication_info.user_name
end

#info_social_security_idObject



12
13
14
# File 'lib/ipizza/authentication_response.rb', line 12

def info_social_security_id
  authentication_info.user_id
end

#success?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/ipizza/authentication_response.rb', line 4

def success?
  %w(3012 3013).include?(@params['VK_SERVICE'])
end

#valid?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/ipizza/authentication_response.rb', line 8

def valid?
  @valid
end