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



480
481
482
483
484
485
486
# File 'lib/schemas.rb', line 480

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



488
489
490
# File 'lib/schemas.rb', line 488

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

Instance Method Details

#to_dynamicObject



492
493
494
495
496
497
# File 'lib/schemas.rb', line 492

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

#to_json(options = nil) ⇒ Object



499
500
501
# File 'lib/schemas.rb', line 499

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