Class: PostMocksResponse401Error

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



24844
24845
24846
24847
24848
24849
24850
# File 'lib/schemas.rb', line 24844

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

.from_json!(json) ⇒ Object



24852
24853
24854
# File 'lib/schemas.rb', line 24852

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

Instance Method Details

#to_dynamicObject



24856
24857
24858
24859
24860
24861
# File 'lib/schemas.rb', line 24856

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

#to_json(options = nil) ⇒ Object



24863
24864
24865
# File 'lib/schemas.rb', line 24863

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