Class: PostMocksMockIDServerResponsesResponse500Error

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



24451
24452
24453
24454
24455
24456
24457
# File 'lib/schemas.rb', line 24451

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

.from_json!(json) ⇒ Object



24459
24460
24461
# File 'lib/schemas.rb', line 24459

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

Instance Method Details

#to_dynamicObject



24463
24464
24465
24466
24467
24468
# File 'lib/schemas.rb', line 24463

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

#to_json(options = nil) ⇒ Object



24470
24471
24472
# File 'lib/schemas.rb', line 24470

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