Class: PostCollectionsForkCollectionIDResponse429

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



21991
21992
21993
21994
21995
21996
21997
# File 'lib/schemas.rb', line 21991

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

.from_json!(json) ⇒ Object



21999
22000
22001
# File 'lib/schemas.rb', line 21999

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

Instance Method Details

#to_dynamicObject



22003
22004
22005
22006
22007
22008
# File 'lib/schemas.rb', line 22003

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

#to_json(options = nil) ⇒ Object



22010
22011
22012
# File 'lib/schemas.rb', line 22010

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