Class: TrueLayerSigning::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/truelayer-signing/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTrueLayerSigning::Config


14
15
16
17
18
19
# File 'lib/truelayer-signing/config.rb', line 14

def initialize
  @algorithm = "ES512".freeze
  @certificate_id = ENV.fetch("TRUELAYER_SIGNING_CERTIFICATE_ID", nil).freeze
  @private_key = ENV.fetch("TRUELAYER_SIGNING_PRIVATE_KEY", nil)&.gsub(/\\n/, "\n").freeze
  @version = "2".freeze
end

Instance Attribute Details

#algorithmObject (readonly)

Returns the value of attribute algorithm.


4
5
6
# File 'lib/truelayer-signing/config.rb', line 4

def algorithm
  @algorithm
end

#certificate_idObject

Returns the value of attribute certificate_id.


3
4
5
# File 'lib/truelayer-signing/config.rb', line 3

def certificate_id
  @certificate_id
end

#private_keyObject

Returns the value of attribute private_key.


3
4
5
# File 'lib/truelayer-signing/config.rb', line 3

def private_key
  @private_key
end

#versionObject (readonly)

Returns the value of attribute version.


4
5
6
# File 'lib/truelayer-signing/config.rb', line 4

def version
  @version
end

Class Method Details

.setupTrueLayerSigning::Config


7
8
9
10
11
# File 'lib/truelayer-signing/config.rb', line 7

def self.setup
  new.tap do |instance|
    yield(instance) if block_given?
  end
end