Class: DeleteMocksMockIDServerResponsesServerResponseIDResponse404Error

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



2733
2734
2735
2736
2737
2738
2739
2740
# File 'lib/schemas.rb', line 2733

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

.from_json!(json) ⇒ Object



2742
2743
2744
# File 'lib/schemas.rb', line 2742

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

Instance Method Details

#to_dynamicObject



2746
2747
2748
2749
2750
2751
2752
# File 'lib/schemas.rb', line 2746

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

#to_json(options = nil) ⇒ Object



2754
2755
2756
# File 'lib/schemas.rb', line 2754

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