Class: CacheValue

Inherits:
Object
  • Object
show all
Defined in:
lib/AuthenticationSDK/util/CacheValue.rb

Overview

Cache value object to store certificate data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(private_key = nil, cert = nil, file_modified_time = nil) ⇒ CacheValue

Returns a new instance of CacheValue.



5
6
7
8
9
# File 'lib/AuthenticationSDK/util/CacheValue.rb', line 5

def initialize(private_key = nil, cert = nil, file_modified_time = nil)
  @private_key = private_key
  @cert = cert
  @file_modified_time = file_modified_time
end

Instance Attribute Details

#certObject

Returns the value of attribute cert.



3
4
5
# File 'lib/AuthenticationSDK/util/CacheValue.rb', line 3

def cert
  @cert
end

#file_modified_timeObject

Returns the value of attribute file_modified_time.



3
4
5
# File 'lib/AuthenticationSDK/util/CacheValue.rb', line 3

def file_modified_time
  @file_modified_time
end

#private_keyObject

Returns the value of attribute private_key.



3
4
5
# File 'lib/AuthenticationSDK/util/CacheValue.rb', line 3

def private_key
  @private_key
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/AuthenticationSDK/util/CacheValue.rb', line 15

def empty?
  @private_key.nil? && @cert.nil? && @file_modified_time.nil?
end

#to_sObject



11
12
13
# File 'lib/AuthenticationSDK/util/CacheValue.rb', line 11

def to_s
  "CacheValue(private_key: #{@private_key ? 'present' : 'nil'}, cert: #{@cert ? 'present' : 'nil'}, file_modified_time: #{@file_modified_time})"
end