Class: FingerprintRequest

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



443
444
445
446
447
448
449
# File 'lib/schemas.rb', line 443

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    fingerprint_material: d.fetch("fingerprintMaterial"),
    public_key:           d.fetch("publicKey"),
  )
end

.from_json!(json) ⇒ Object



451
452
453
# File 'lib/schemas.rb', line 451

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



455
456
457
458
459
460
# File 'lib/schemas.rb', line 455

def to_dynamic
  {
    "fingerprintMaterial" => fingerprint_material,
    "publicKey"           => public_key,
  }
end

#to_json(options = nil) ⇒ Object



462
463
464
# File 'lib/schemas.rb', line 462

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end