Class: PostMocksMockIDPublishResponse429

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



24079
24080
24081
24082
24083
24084
24085
# File 'lib/schemas.rb', line 24079

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

.from_json!(json) ⇒ Object



24087
24088
24089
# File 'lib/schemas.rb', line 24087

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

Instance Method Details

#to_dynamicObject



24091
24092
24093
24094
24095
24096
# File 'lib/schemas.rb', line 24091

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

#to_json(options = nil) ⇒ Object



24098
24099
24100
# File 'lib/schemas.rb', line 24098

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