Class: VerificationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/trustcaptcha/model/verification_result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ VerificationResult

Returns a new instance of VerificationResult.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/trustcaptcha/model/verification_result.rb', line 12

def initialize(data)
  @captcha_id = data['captchaId']
  @verification_id = data['verificationId']
  @verification_passed = data['verificationPassed']
  @score = data['score']
  @decision_type = data['decisionType']
  @decision_action = data['decisionAction']
  @gateway_failover_active = data['gatewayFailoverActive']
  @risk_scoring_enabled = data['riskScoringEnabled']
  @minimal_data_mode_enabled = data['minimalDataModeEnabled']
  @origin = data['origin']
  @ip_address = data['ipAddress']
  @country_code = data['countryCode']
  @device_family = data['deviceFamily']
  @operating_system = data['operatingSystem']
  @browser = data['browser']
  @verification_started_at = data['verificationStartedAt']
  @verification_finished_at = data['verificationFinishedAt']
  @result_expires_at = data['resultExpiresAt']
  @result_first_fetched_at = data['resultFirstFetchedAt']
  @result_last_fetched_at = data['resultLastFetchedAt']
end

Instance Attribute Details

#browserObject (readonly)

Returns the value of attribute browser.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def browser
  @browser
end

#captcha_idObject (readonly)

Returns the value of attribute captcha_id.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def captcha_id
  @captcha_id
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def country_code
  @country_code
end

#decision_actionObject (readonly)

Returns the value of attribute decision_action.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def decision_action
  @decision_action
end

#decision_typeObject (readonly)

Returns the value of attribute decision_type.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def decision_type
  @decision_type
end

#device_familyObject (readonly)

Returns the value of attribute device_family.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def device_family
  @device_family
end

#gateway_failover_activeObject (readonly)

Returns the value of attribute gateway_failover_active.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def gateway_failover_active
  @gateway_failover_active
end

#ip_addressObject (readonly)

Returns the value of attribute ip_address.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def ip_address
  @ip_address
end

#minimal_data_mode_enabledObject (readonly)

Returns the value of attribute minimal_data_mode_enabled.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def minimal_data_mode_enabled
  @minimal_data_mode_enabled
end

#operating_systemObject (readonly)

Returns the value of attribute operating_system.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def operating_system
  @operating_system
end

#originObject (readonly)

Returns the value of attribute origin.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def origin
  @origin
end

#result_expires_atObject (readonly)

Returns the value of attribute result_expires_at.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def result_expires_at
  @result_expires_at
end

#result_first_fetched_atObject (readonly)

Returns the value of attribute result_first_fetched_at.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def result_first_fetched_at
  @result_first_fetched_at
end

#result_last_fetched_atObject (readonly)

Returns the value of attribute result_last_fetched_at.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def result_last_fetched_at
  @result_last_fetched_at
end

#risk_scoring_enabledObject (readonly)

Returns the value of attribute risk_scoring_enabled.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def risk_scoring_enabled
  @risk_scoring_enabled
end

#scoreObject (readonly)

Returns the value of attribute score.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def score
  @score
end

#verification_finished_atObject (readonly)

Returns the value of attribute verification_finished_at.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def verification_finished_at
  @verification_finished_at
end

#verification_idObject (readonly)

Returns the value of attribute verification_id.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def verification_id
  @verification_id
end

#verification_passedObject (readonly)

Returns the value of attribute verification_passed.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def verification_passed
  @verification_passed
end

#verification_started_atObject (readonly)

Returns the value of attribute verification_started_at.



4
5
6
# File 'lib/trustcaptcha/model/verification_result.rb', line 4

def verification_started_at
  @verification_started_at
end

Class Method Details

.from_json(json_data) ⇒ Object



35
36
37
38
# File 'lib/trustcaptcha/model/verification_result.rb', line 35

def self.from_json(json_data)
  data = JSON.parse(json_data)
  new(data)
end

Instance Method Details

#to_json(*_args) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/trustcaptcha/model/verification_result.rb', line 40

def to_json(*_args)
  {
    captchaId: @captcha_id,
    verificationId: @verification_id,
    verificationPassed: @verification_passed,
    score: @score,
    decisionType: @decision_type,
    decisionAction: @decision_action,
    gatewayFailoverActive: @gateway_failover_active,
    riskScoringEnabled: @risk_scoring_enabled,
    minimalDataModeEnabled: @minimal_data_mode_enabled,
    origin: @origin,
    ipAddress: @ip_address,
    countryCode: @country_code,
    deviceFamily: @device_family,
    operatingSystem: @operating_system,
    browser: @browser,
    verificationStartedAt: @verification_started_at,
    verificationFinishedAt: @verification_finished_at,
    resultExpiresAt: @result_expires_at,
    resultFirstFetchedAt: @result_first_fetched_at,
    resultLastFetchedAt: @result_last_fetched_at
  }.to_json
end