Class: PutMocksMockIDResponse429

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



32779
32780
32781
32782
32783
32784
32785
# File 'lib/schemas.rb', line 32779

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

.from_json!(json) ⇒ Object



32787
32788
32789
# File 'lib/schemas.rb', line 32787

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

Instance Method Details

#to_dynamicObject



32791
32792
32793
32794
32795
32796
# File 'lib/schemas.rb', line 32791

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

#to_json(options = nil) ⇒ Object



32798
32799
32800
# File 'lib/schemas.rb', line 32798

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