Class: FingerprintResponse

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



2327
2328
2329
2330
2331
2332
# File 'lib/schemas.rb', line 2327

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    fingerprint: d.fetch("fingerprint"),
  )
end

.from_json!(json) ⇒ Object



2334
2335
2336
# File 'lib/schemas.rb', line 2334

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

Instance Method Details

#to_dynamicObject



2338
2339
2340
2341
2342
# File 'lib/schemas.rb', line 2338

def to_dynamic
  {
    "fingerprint" => fingerprint,
  }
end

#to_json(options = nil) ⇒ Object



2344
2345
2346
# File 'lib/schemas.rb', line 2344

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