Class: Bankid::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/bankid/authentication.rb

Constant Summary collapse

ATTRS =
%i[order_ref auto_start_token qr_start_token qr_start_secret].freeze

Instance Method Summary collapse

Constructor Details

#initialize(order_ref:, auto_start_token:, qr_start_token:, qr_start_secret:) ⇒ Authentication

Returns a new instance of Authentication.



8
9
10
11
12
13
# File 'lib/bankid/authentication.rb', line 8

def initialize(order_ref:, auto_start_token:, qr_start_token:, qr_start_secret:)
  @order_ref = order_ref
  @auto_start_token = auto_start_token
  @qr_start_token = qr_start_token
  @qr_start_secret = qr_start_secret
end

Instance Method Details

#==(other) ⇒ Object



19
20
21
# File 'lib/bankid/authentication.rb', line 19

def ==(other)
  ATTRS.all? { |a| send(a) == other.send(a) }
end

#to_hObject



15
16
17
# File 'lib/bankid/authentication.rb', line 15

def to_h
  ATTRS.to_h { |a| [a, send(a)] }
end