Class: GetMeResponse429

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



10424
10425
10426
10427
10428
10429
10430
# File 'lib/schemas.rb', line 10424

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

.from_json!(json) ⇒ Object



10432
10433
10434
# File 'lib/schemas.rb', line 10432

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

Instance Method Details

#to_dynamicObject



10436
10437
10438
10439
10440
10441
# File 'lib/schemas.rb', line 10436

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

#to_json(options = nil) ⇒ Object



10443
10444
10445
# File 'lib/schemas.rb', line 10443

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