Class: PostMocksMockIDServerResponsesResponse429

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



24419
24420
24421
24422
24423
24424
24425
# File 'lib/schemas.rb', line 24419

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

.from_json!(json) ⇒ Object



24427
24428
24429
# File 'lib/schemas.rb', line 24427

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

Instance Method Details

#to_dynamicObject



24431
24432
24433
24434
24435
24436
# File 'lib/schemas.rb', line 24431

def to_dynamic
  {
    "error"   => error,
    "message" => message,
  }
end

#to_json(options = nil) ⇒ Object



24438
24439
24440
# File 'lib/schemas.rb', line 24438

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