Class: GetMocksMockIDServerResponsesServerResponseIDResponse500Error

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



11961
11962
11963
11964
11965
11966
11967
# File 'lib/schemas.rb', line 11961

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

.from_json!(json) ⇒ Object



11969
11970
11971
# File 'lib/schemas.rb', line 11969

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

Instance Method Details

#to_dynamicObject



11973
11974
11975
11976
11977
11978
# File 'lib/schemas.rb', line 11973

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

#to_json(options = nil) ⇒ Object



11980
11981
11982
# File 'lib/schemas.rb', line 11980

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