Class: PutMocksMockIDResponse404Error

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



32720
32721
32722
32723
32724
32725
32726
32727
# File 'lib/schemas.rb', line 32720

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

.from_json!(json) ⇒ Object



32729
32730
32731
# File 'lib/schemas.rb', line 32729

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

Instance Method Details

#to_dynamicObject



32733
32734
32735
32736
32737
32738
32739
# File 'lib/schemas.rb', line 32733

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

#to_json(options = nil) ⇒ Object



32741
32742
32743
# File 'lib/schemas.rb', line 32741

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