Class: GetMeResponse401Error

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



10367
10368
10369
10370
10371
10372
10373
# File 'lib/schemas.rb', line 10367

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

.from_json!(json) ⇒ Object



10375
10376
10377
# File 'lib/schemas.rb', line 10375

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

Instance Method Details

#to_dynamicObject



10379
10380
10381
10382
10383
10384
# File 'lib/schemas.rb', line 10379

def to_dynamic
  {
    "message" => message,
    "name"    => get_me_response401_error_name,
  }
end

#to_json(options = nil) ⇒ Object



10386
10387
10388
# File 'lib/schemas.rb', line 10386

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