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



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

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

Instance Attribute Details

#algorithmObject (readonly)

Returns the value of attribute algorithm.



6
7
8
# File 'lib/truelayer-signing/config.rb', line 6

def algorithm
  @algorithm
end

#certificate_idObject

Returns the value of attribute certificate_id.



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

def certificate_id
  @certificate_id
end

#private_keyObject

Returns the value of attribute private_key.



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

def private_key
  @private_key
end

#versionObject (readonly)

Returns the value of attribute version.



6
7
8
# File 'lib/truelayer-signing/config.rb', line 6

def version
  @version
end

Class Method Details

.setupTrueLayerSigning::Config



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

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