Class: WebAuthn::AuthenticatorData::Flags

Inherits:
Object
  • Object
show all
Defined in:
lib/web_authn/authenticator_data/flags.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(up:, uv:, at:, ex:) ⇒ Flags

Returns a new instance of Flags.



10
11
12
13
14
15
# File 'lib/web_authn/authenticator_data/flags.rb', line 10

def initialize(up:, uv:, at:, ex:)
  self.up = up
  self.uv = uv
  self.at = at
  self.ex = ex
end

Class Method Details

.decode(input) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/web_authn/authenticator_data/flags.rb', line 18

def decode(input)
  bit_array = input.getbyte(0)
  new(
    up: bit_array[0] == 1,
    uv: bit_array[2] == 1,
    at: bit_array[6] == 1,
    ex: bit_array[7] == 1
  )
end