Class: Signature5VerificationResult
- Inherits:
-
Object
- Object
- Signature5VerificationResult
- Defined in:
- lib/ruby-common/v5/Signature5VerificationResult.rb
Instance Attribute Summary collapse
-
#additional_data ⇒ Object
Other, which has not been mapped to a field, or getting error during parsing.
-
#apple_sense ⇒ Object
Detected iPhone/iPad model by Adscore AppleSense.
-
#b_platform ⇒ Object
User-Agent Client Hints Platform.
-
#cpu_cores ⇒ Object
Number of CPU logical cores gathered from navigator.hardwareConcurrency.
-
#data ⇒ Object
Data.
-
#gpu ⇒ Object
GPU Model obtained from WebGL and WebGPU APIs.
-
#horizontal_resolution ⇒ Object
Physical screen horizontal resolution.
-
#incognito ⇒ Object
Indicates whether visitor is using Private Browsing (Incognito) Mode.
-
#ipv4_ip ⇒ Object
IPv4 address.
-
#ipv4_v ⇒ Object
Number of bytes required for IP matching.
-
#ipv6_ip ⇒ Object
IPv6 address.
-
#ipv6_v ⇒ Object
Number of left-most bytes of IPv6 address needed to match.
-
#platform_v ⇒ Object
Content of Sec-CH-UA-Platform-Version request header.
-
#ram ⇒ Object
Amount of RAM memory in GB gathered from navigator.deviceMemory.
-
#request_time ⇒ Object
Request time.
-
#result ⇒ Object
Detection result as number, one of following: 0, 3, 6, 9.
-
#signature_time ⇒ Object
Signature time.
-
#sub_id ⇒ Object
Adscore zone subId.
-
#token ⇒ Object
Token.
-
#true_ua ⇒ Object
Adscore TrueUA-enriched User-Agent.
-
#true_ua_location ⇒ Object
Adscore True Location Country.
-
#true_ua_location_c ⇒ Object
Adscore True Location Confidence.
-
#truech_arch ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Arch.
-
#truech_bitness ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Bitness.
-
#truech_full_v ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Full-Version.
-
#truech_mobile ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Mobile.
-
#truech_model ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Model.
-
#truech_platform ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Platform.
-
#truech_platform_v ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Platform-Version.
-
#truech_ua ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA.
-
#tz_offset ⇒ Object
Timezone offset from GMT in minutes.
-
#verdict ⇒ Object
Detection result as text, one of following: ok, junk, proxy, bot.
-
#vertical_resolution ⇒ Object
Physical screen vertical resolution.
-
#visitor_user_agent ⇒ Object
Visitor’s User Agent.
-
#zone_id ⇒ Object
Zone-id.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Signature5VerificationResult
constructor
A new instance of Signature5VerificationResult.
- #to_s ⇒ Object
Constructor Details
#initialize(hash) ⇒ Signature5VerificationResult
Returns a new instance of Signature5VerificationResult.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 73 def initialize(hash) @zone_id = hash.delete('zone_id')&.to_i @result = hash.delete('result')&.to_i @verdict = hash.delete('verdict') @visitor_user_agent = hash.delete('b.ua') @data = hash.delete('data') @ipv4_ip = hash.delete('ipv4.ip') @ipv4_v = hash.delete('ipv4.v')&.to_i @ipv6_ip = hash.delete('ipv6.ip') @ipv6_v = hash.delete('ipv6.v')&.to_i @cpu_cores = hash.delete('b.cpucores')&.to_i @ram = hash.delete('b.ram')&.to_i @tz_offset = hash.delete('b.tzoffset')&.to_i @b_platform = hash.delete('b.platform') @platform_v = hash.delete('b.platform.v') @gpu = hash.delete('b.gpu') @apple_sense = hash.delete('apple_sense') @horizontal_resolution = hash.delete('b.sr.w')&.to_i @vertical_resolution = hash.delete('b.sr.h')&.to_i @true_ua = hash.delete('b.trueua') @true_ua_location = hash.delete('b.trueloc.c') @true_ua_location_c = hash.delete('b.truech.location.c')&.to_i @truech_ua = hash.delete('b.truech.ua') @truech_arch = hash.delete('b.truech.arch') @truech_bitness = hash.delete('b.truech.bitness')&.to_i @truech_model = hash.delete('b.truech.model') @truech_platform = hash.delete('b.truech.platform') @truech_platform_v = hash.delete('b.truech.platform.v') @truech_full_v = hash.delete('b.truech.full.v') @truech_mobile = hash.delete('b.truech.mobile') @incognito = hash.delete('incognito') @sub_id = hash.delete('sub_id') @request_time = hash.delete('requestTime')&.to_i @signature_time = hash.delete('signatureTime')&.to_i @token = hash.delete('token') @additional_data = hash end |
Instance Attribute Details
#additional_data ⇒ Object
Other, which has not been mapped to a field, or getting error during parsing
71 72 73 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 71 def additional_data @additional_data end |
#apple_sense ⇒ Object
Detected iPhone/iPad model by Adscore AppleSense
33 34 35 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 33 def apple_sense @apple_sense end |
#b_platform ⇒ Object
User-Agent Client Hints Platform
27 28 29 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 27 def b_platform @b_platform end |
#cpu_cores ⇒ Object
Number of CPU logical cores gathered from navigator.hardwareConcurrency
21 22 23 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 21 def cpu_cores @cpu_cores end |
#data ⇒ Object
Data
11 12 13 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 11 def data @data end |
#gpu ⇒ Object
GPU Model obtained from WebGL and WebGPU APIs
31 32 33 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 31 def gpu @gpu end |
#horizontal_resolution ⇒ Object
Physical screen horizontal resolution
35 36 37 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 35 def horizontal_resolution @horizontal_resolution end |
#incognito ⇒ Object
Indicates whether visitor is using Private Browsing (Incognito) Mode
61 62 63 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 61 def incognito @incognito end |
#ipv4_ip ⇒ Object
IPv4 address
13 14 15 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 13 def ipv4_ip @ipv4_ip end |
#ipv4_v ⇒ Object
Number of bytes required for IP matching
15 16 17 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 15 def ipv4_v @ipv4_v end |
#ipv6_ip ⇒ Object
IPv6 address
17 18 19 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 17 def ipv6_ip @ipv6_ip end |
#ipv6_v ⇒ Object
Number of left-most bytes of IPv6 address needed to match
19 20 21 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 19 def ipv6_v @ipv6_v end |
#platform_v ⇒ Object
Content of Sec-CH-UA-Platform-Version request header
29 30 31 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 29 def platform_v @platform_v end |
#ram ⇒ Object
Amount of RAM memory in GB gathered from navigator.deviceMemory
23 24 25 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 23 def ram @ram end |
#request_time ⇒ Object
Request time
65 66 67 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 65 def request_time @request_time end |
#result ⇒ Object
Detection result as number, one of following: 0, 3, 6, 9
5 6 7 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 5 def result @result end |
#signature_time ⇒ Object
Signature time
67 68 69 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 67 def signature_time @signature_time end |
#sub_id ⇒ Object
Adscore zone subId
63 64 65 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 63 def sub_id @sub_id end |
#token ⇒ Object
Token
69 70 71 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 69 def token @token end |
#true_ua ⇒ Object
Adscore TrueUA-enriched User-Agent
39 40 41 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 39 def true_ua @true_ua end |
#true_ua_location ⇒ Object
Adscore True Location Country
41 42 43 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 41 def true_ua_location @true_ua_location end |
#true_ua_location_c ⇒ Object
Adscore True Location Confidence
43 44 45 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 43 def true_ua_location_c @true_ua_location_c end |
#truech_arch ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Arch
47 48 49 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 47 def truech_arch @truech_arch end |
#truech_bitness ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Bitness
49 50 51 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 49 def truech_bitness @truech_bitness end |
#truech_full_v ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Full-Version
57 58 59 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 57 def truech_full_v @truech_full_v end |
#truech_mobile ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Mobile
59 60 61 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 59 def truech_mobile @truech_mobile end |
#truech_model ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Model
51 52 53 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 51 def truech_model @truech_model end |
#truech_platform ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Platform
53 54 55 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 53 def truech_platform @truech_platform end |
#truech_platform_v ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA-Platform-Version
55 56 57 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 55 def truech_platform_v @truech_platform_v end |
#truech_ua ⇒ Object
Adscore TrueUA-enriched Client Hints header Sec-CH-UA
45 46 47 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 45 def truech_ua @truech_ua end |
#tz_offset ⇒ Object
Timezone offset from GMT in minutes
25 26 27 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 25 def tz_offset @tz_offset end |
#verdict ⇒ Object
Detection result as text, one of following: ok, junk, proxy, bot
7 8 9 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 7 def verdict @verdict end |
#vertical_resolution ⇒ Object
Physical screen vertical resolution
37 38 39 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 37 def vertical_resolution @vertical_resolution end |
#visitor_user_agent ⇒ Object
Visitor’s User Agent
9 10 11 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 9 def visitor_user_agent @visitor_user_agent end |
#zone_id ⇒ Object
Zone-id
3 4 5 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 3 def zone_id @zone_id end |
Instance Method Details
#to_s ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/ruby-common/v5/Signature5VerificationResult.rb', line 111 def to_s <<~STRING Zone ID: #{@zone_id} Result: #{@result} Verdict: #{@verdict} Visitor User Agent: #{@visitor_user_agent} Data: #{@data} IPv4 IP: #{@ipv4_ip} IPv4 Version: #{@ipv4_v} IPv6 IP: #{@ipv6_ip} IPv6 Version: #{@ipv6_v} CPU Cores: #{@cpu_cores} RAM: #{@ram} Time Zone Offset: #{@tz_offset} Browser Platform: #{@b_platform} Platform Version: #{@platform_v} GPU: #{@gpu} Apple Sense: #{@apple_sense} Horizontal Resolution: #{@horizontal_resolution} Vertical Resolution: #{@vertical_resolution} True User Agent: #{@true_ua} True User Agent Location: #{@true_ua_location} True User Agent Location Code: #{@true_ua_location_c} Truech User Agent: #{@truech_ua} Truech Architecture: #{@truech_arch} Truech Bitness: #{@truech_bitness} Truech Model: #{@truech_model} Truech Platform: #{@truech_platform} Truech Platform Version: #{@truech_platform_v} Truech Full Version: #{@truech_full_v} Truech Mobile: #{@truech_mobile} Incognito: #{@incognito} Subscriber ID: #{@sub_id} Request Time: #{@request_time} Signature Time: #{@signature_time} Token: #{@token} Additional Data: #{@additional_data} STRING end |