Class: PostMocksResponse500Error

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



24933
24934
24935
24936
24937
24938
24939
# File 'lib/schemas.rb', line 24933

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

.from_json!(json) ⇒ Object



24941
24942
24943
# File 'lib/schemas.rb', line 24941

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

Instance Method Details

#to_dynamicObject



24945
24946
24947
24948
24949
24950
# File 'lib/schemas.rb', line 24945

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

#to_json(options = nil) ⇒ Object



24952
24953
24954
# File 'lib/schemas.rb', line 24952

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