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



2576
2577
2578
2579
2580
2581
# File 'lib/schemas.rb', line 2576

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

.from_json!(json) ⇒ Object



2583
2584
2585
# File 'lib/schemas.rb', line 2583

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

Instance Method Details

#to_dynamicObject



2587
2588
2589
2590
2591
# File 'lib/schemas.rb', line 2587

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

#to_json(options = nil) ⇒ Object



2593
2594
2595
# File 'lib/schemas.rb', line 2593

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