Class: GetMocksResponse500Error

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



12373
12374
12375
12376
12377
12378
12379
# File 'lib/schemas.rb', line 12373

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    message:                          d["message"],
    get_mocks_response500_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



12381
12382
12383
# File 'lib/schemas.rb', line 12381

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

Instance Method Details

#to_dynamicObject



12385
12386
12387
12388
12389
12390
# File 'lib/schemas.rb', line 12385

def to_dynamic
  {
    "message" => message,
    "name"    => get_mocks_response500_error_name,
  }
end

#to_json(options = nil) ⇒ Object



12392
12393
12394
# File 'lib/schemas.rb', line 12392

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