Class: GetMocksMockIDServerResponsesServerResponseIDResponse404Error

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



11870
11871
11872
11873
11874
11875
11876
11877
# File 'lib/schemas.rb', line 11870

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

.from_json!(json) ⇒ Object



11879
11880
11881
# File 'lib/schemas.rb', line 11879

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

Instance Method Details

#to_dynamicObject



11883
11884
11885
11886
11887
11888
11889
# File 'lib/schemas.rb', line 11883

def to_dynamic
  {
    "details" => details,
    "message" => message,
    "name"    => get_mocks_mock_id_server_responses_server_response_id_response404_error_name,
  }
end

#to_json(options = nil) ⇒ Object



11891
11892
11893
# File 'lib/schemas.rb', line 11891

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