Class: PutMocksMockIDResponse500Error

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



32811
32812
32813
32814
32815
32816
32817
# File 'lib/schemas.rb', line 32811

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

.from_json!(json) ⇒ Object



32819
32820
32821
# File 'lib/schemas.rb', line 32819

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

Instance Method Details

#to_dynamicObject



32823
32824
32825
32826
32827
32828
# File 'lib/schemas.rb', line 32823

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

#to_json(options = nil) ⇒ Object



32830
32831
32832
# File 'lib/schemas.rb', line 32830

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