Class: GetMocksMockIDResponse429

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



11399
11400
11401
11402
11403
11404
11405
# File 'lib/schemas.rb', line 11399

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

.from_json!(json) ⇒ Object



11407
11408
11409
# File 'lib/schemas.rb', line 11407

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

Instance Method Details

#to_dynamicObject



11411
11412
11413
11414
11415
11416
# File 'lib/schemas.rb', line 11411

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

#to_json(options = nil) ⇒ Object



11418
11419
11420
# File 'lib/schemas.rb', line 11418

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