Class: GetMocksResponse429

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



12341
12342
12343
12344
12345
12346
12347
# File 'lib/schemas.rb', line 12341

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

.from_json!(json) ⇒ Object



12349
12350
12351
# File 'lib/schemas.rb', line 12349

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

Instance Method Details

#to_dynamicObject



12353
12354
12355
12356
12357
12358
# File 'lib/schemas.rb', line 12353

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

#to_json(options = nil) ⇒ Object



12360
12361
12362
# File 'lib/schemas.rb', line 12360

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