Class: Signature4VerificationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-common/v4/Signature4VerificationResult.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(score:, verdict:, ip_address:, request_time:, signature_time:, expired: false) ⇒ Signature4VerificationResult

Returns a new instance of Signature4VerificationResult.



5
6
7
8
9
10
11
12
13
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 5

def initialize(score:, verdict:, ip_address:, request_time:, 
               signature_time:, expired: false)
  @score = score
  @verdict = verdict
  @ip_address = ip_address
  @request_time = request_time
  @signature_time = signature_time
  @expired = expired
end

Instance Attribute Details

#expiredObject

Returns the value of attribute expired.



2
3
4
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 2

def expired
  @expired
end

#ip_addressObject

Returns the value of attribute ip_address.



2
3
4
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 2

def ip_address
  @ip_address
end

#request_timeObject

Returns the value of attribute request_time.



2
3
4
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 2

def request_time
  @request_time
end

#scoreObject

Returns the value of attribute score.



2
3
4
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 2

def score
  @score
end

#signature_timeObject

Returns the value of attribute signature_time.



2
3
4
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 2

def signature_time
  @signature_time
end

#verdictObject

Returns the value of attribute verdict.



2
3
4
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 2

def verdict
  @verdict
end

Class Method Details

.is_expiredObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 15

def self.is_expired()
  new(
    score: nil,
    verdict: nil,
    ip_address: nil,
    request_time: nil,
    signature_time: nil,
    expired: true
  )
end

Instance Method Details

#to_hObject



26
27
28
29
30
31
32
33
34
35
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 26

def to_h
  {
    score: @score,
    verdict: @verdict,
    ip_address: @ip_address,
    request_time: @request_time,
    signature_time: @signature_time,
    expired: @expired
  }
end

#to_sObject



37
38
39
# File 'lib/ruby-common/v4/Signature4VerificationResult.rb', line 37

def to_s
  "ValidationResult(score: #{@score}, verdict: #{@verdict}, ip_address: #{@ip_address}, request_time: #{@request_time}, signature_time: #{@signature_time}, expired: #{@expired})"
end