Class: PostMonitorsMonitorIDRunResponseRunStatsAssertions

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



25310
25311
25312
25313
25314
25315
25316
# File 'lib/schemas.rb', line 25310

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

.from_json!(json) ⇒ Object



25318
25319
25320
# File 'lib/schemas.rb', line 25318

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

Instance Method Details

#to_dynamicObject



25322
25323
25324
25325
25326
25327
# File 'lib/schemas.rb', line 25322

def to_dynamic
  {
    "failed" => failed,
    "total"  => total,
  }
end

#to_json(options = nil) ⇒ Object



25329
25330
25331
# File 'lib/schemas.rb', line 25329

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