Class: PostMonitorsResponse429

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



25853
25854
25855
25856
25857
25858
25859
# File 'lib/schemas.rb', line 25853

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

.from_json!(json) ⇒ Object



25861
25862
25863
# File 'lib/schemas.rb', line 25861

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

Instance Method Details

#to_dynamicObject



25865
25866
25867
25868
25869
25870
# File 'lib/schemas.rb', line 25865

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

#to_json(options = nil) ⇒ Object



25872
25873
25874
# File 'lib/schemas.rb', line 25872

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