Class: PostNetworkPrivateResponse404Error

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



26056
26057
26058
26059
26060
26061
26062
# File 'lib/schemas.rb', line 26056

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

.from_json!(json) ⇒ Object



26064
26065
26066
# File 'lib/schemas.rb', line 26064

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

Instance Method Details

#to_dynamicObject



26068
26069
26070
26071
26072
26073
# File 'lib/schemas.rb', line 26068

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

#to_json(options = nil) ⇒ Object



26075
26076
26077
# File 'lib/schemas.rb', line 26075

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